diff --git a/pod/authentication/models.py b/pod/authentication/models.py index 4e5abdae1d..b788045410 100644 --- a/pod/authentication/models.py +++ b/pod/authentication/models.py @@ -64,10 +64,16 @@ FILES_DIR = getattr(settings, "FILES_DIR", "files") -def get_name(self): - if HIDE_USERNAME: - return "%s %s" % (self.first_name, self.last_name) - return "%s %s (%s)" % (self.first_name, self.last_name, self.username) +def get_name(self) -> str: + """ + Returns the user's full name, including the username if not hidden. + + Returns: + str: The user's full name and username if not hidden. + """ + if HIDE_USERNAME or not self.is_authenticated: + return self.get_full_name().strip() + return f"{self.get_full_name()} ({self.get_username()})".strip() User.add_to_class("__str__", get_name) diff --git a/pod/enrichment/templates/enrichment/video_enrichment.html b/pod/enrichment/templates/enrichment/video_enrichment.html index 8ac576c6ed..82b12fe2e0 100644 --- a/pod/enrichment/templates/enrichment/video_enrichment.html +++ b/pod/enrichment/templates/enrichment/video_enrichment.html @@ -19,7 +19,7 @@ - + @@ -32,7 +32,7 @@ - + diff --git a/pod/live/templates/live/event-info.html b/pod/live/templates/live/event-info.html index 03ebe960e2..19cb538e25 100644 --- a/pod/live/templates/live/event-info.html +++ b/pod/live/templates/live/event-info.html @@ -40,13 +40,14 @@