Skip to content

Commit

Permalink
DWPF-783 Bug fix - None was displayed if location in building field w…
Browse files Browse the repository at this point in the history
…as left blank (#465)
  • Loading branch information
nicopicchio authored Sep 22, 2023
1 parent d0703f7 commit 0a4998d
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions src/peoplefinder/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -807,14 +807,13 @@ def get_workdays_display(self) -> str:
return ", ".join(map(str, workdays))

def get_office_location_display(self) -> Optional[str]:
if self.uk_office_location:
return mark_safe( # noqa: S308
self.uk_office_location.name
+ "<br>"
+ strip_tags(self.location_in_building)
)
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

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

0 comments on commit 0a4998d

Please sign in to comment.