Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DWPF-783 Bug fix - None was displayed if location in building field was left blank #465

11 changes: 5 additions & 6 deletions src/peoplefinder/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -800,14 +800,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
nicopicchio marked this conversation as resolved.
Show resolved Hide resolved
return None

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