Skip to content

Commit

Permalink
Remove "missingMapsProfile" & "osmProfile" User DTO fields
Browse files Browse the repository at this point in the history
  • Loading branch information
NatashaKSS authored and d-rita committed Aug 3, 2021
1 parent cc14789 commit 153ed22
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 13 deletions.
2 changes: 0 additions & 2 deletions backend/models/dtos/user_dto.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,6 @@ class UserDTO(Model):
teams_notifications = BooleanType(serialized_name="teamsNotifications")

# these are read only
missing_maps_profile = StringType(serialized_name="missingMapsProfile")
osm_profile = StringType(serialized_name="osmProfile")
gender = StringType(
serialized_name="gender",
choices=("MALE", "FEMALE", "SELF_DESCRIBE", "PREFER_NOT"),
Expand Down
11 changes: 0 additions & 11 deletions backend/models/postgis/user.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
from backend import db
from sqlalchemy import desc, func
from geoalchemy2 import functions
from flask import current_app
from backend.models.dtos.user_dto import (
UserDTO,
UserMappedProjectsDTO,
Expand Down Expand Up @@ -68,14 +67,6 @@ class User(db.Model):
accepted_licenses = db.relationship("License", secondary=user_licenses_table)
interests = db.relationship(Interest, secondary=user_interests, backref="users")

@property
def missing_maps_profile_url(self):
return f"http://www.missingmaps.org/users/#/{self.username}"

@property
def osm_profile_url(self):
return f"{current_app.config['OSM_SERVER_URL']}/user/{self.username}"

def create(self):
""" Creates and saves the current model to the DB """
db.session.add(self)
Expand Down Expand Up @@ -364,8 +355,6 @@ def as_dto(self, logged_in_username: str) -> UserDTO:
user_dto.country = self.country
user_dto.name = self.name
user_dto.picture_url = self.picture_url
user_dto.osm_profile = self.osm_profile_url
user_dto.missing_maps_profile = self.missing_maps_profile_url
user_dto.default_editor = self.default_editor
user_dto.mentions_notifications = self.mentions_notifications
user_dto.projects_notifications = self.projects_notifications
Expand Down

0 comments on commit 153ed22

Please sign in to comment.