Skip to content

Commit

Permalink
Remove unnecesary conversion
Browse files Browse the repository at this point in the history
Also do not rely on falsiness; the first_last format is 0 and thus
falsy. It's not a problem here because that's also the default, but this
is a pure coincidence...
  • Loading branch information
ThiefMaster committed Jul 12, 2023
1 parent b26cadd commit 2d7efea
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions indico/modules/events/fields.py
Expand Up @@ -117,8 +117,8 @@ def name_format(self):
from indico.modules.users.models.users import NameFormat
name_format = layout_settings.get(self.event, 'name_format') if self.event else None
if name_format is None and session.user:
name_format = NameFormat(session.user.settings.get('name_format'))
return name_format or NameFormat.first_last
name_format = session.user.settings.get('name_format')
return name_format if name_format is not None else NameFormat.first_last

@property
def validate_email_url(self):
Expand Down

0 comments on commit 2d7efea

Please sign in to comment.