Skip to content

Commit

Permalink
refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
nicopicchio committed Dec 19, 2024
1 parent 8958699 commit 5bb4dca
Showing 1 changed file with 11 additions and 17 deletions.
28 changes: 11 additions & 17 deletions src/peoplefinder/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -837,26 +837,20 @@ def get_workdays_display(self) -> str:
# "Monday, Tuesday, Wednesday, ..."
return ", ".join(map(str, workdays))

def get_office_location_display(self) -> Optional[str]:
def get_office_location_display(self) -> str:
if self.international_building:
return self.international_building

location_parts = []

if self.location_in_building:
location_parts.append(escape(strip_tags(self.location_in_building)))

if self.uk_office_location:
location_display = (
self.uk_office_location.building_name
+ "<br>"
+ self.uk_office_location.city
)
if self.location_in_building:
location_display = (
strip_tags(self.location_in_building)
+ "<br>"
+ self.uk_office_location.building_name
+ "<br>"
+ self.uk_office_location.city
)
escape(location_display)
return mark_safe(location_display) # noqa: S308
return None
location_parts.append(self.uk_office_location.building_name)
location_parts.append(self.uk_office_location.city)

return mark_safe("<br>".join(location_parts)) # noqa: S308

def get_manager_display(self) -> Optional[str]:
if self.manager:
Expand Down

0 comments on commit 5bb4dca

Please sign in to comment.