From 0a4998d380090167d36b6b620b7c5f67b059222a Mon Sep 17 00:00:00 2001 From: Nico Picchio <70696511+nicopicchio@users.noreply.github.com> Date: Fri, 22 Sep 2023 15:09:28 +0100 Subject: [PATCH] DWPF-783 Bug fix - None was displayed if location in building field was left blank (#465) --- src/peoplefinder/models.py | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/peoplefinder/models.py b/src/peoplefinder/models.py index 094b99d6f..e83d5027e 100644 --- a/src/peoplefinder/models.py +++ b/src/peoplefinder/models.py @@ -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 - + "
" - + 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 += "
" + strip_tags(self.location_in_building) + return mark_safe(location_display) # noqa: S308 return None def get_manager_display(self) -> Optional[str]: