Skip to content

Commit

Permalink
refactor to only use mark safe once
Browse files Browse the repository at this point in the history
  • Loading branch information
nicopicchio committed Sep 22, 2023
1 parent c121089 commit 43a29f7
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions src/peoplefinder/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -802,13 +802,12 @@ def get_workdays_display(self) -> str:
def get_office_location_display(self) -> Optional[str]:
if self.international_building:
return self.international_building
if self.uk_office_location:
location_display = self.uk_office_location.name
if self.location_in_building:
location_display += "<br>" + strip_tags(self.location_in_building)
return mark_safe(location_display) # noqa: S308
return None

if self.uk_office_location and not self.location_in_building:
return self.uk_office_location.name
return mark_safe(
self.uk_office_location.name + "<br>" + strip_tags(self.location_in_building)
)

def get_manager_display(self) -> Optional[str]:
if self.manager:
return mark_safe( # noqa: S308
Expand Down

0 comments on commit 43a29f7

Please sign in to comment.