Skip to content

Commit

Permalink
Make watchlist message easier to override
Browse files Browse the repository at this point in the history
MAGFest wants this to say "security," not "manager," but MFF wants the opposite, so we'll override via event plugin.
  • Loading branch information
kitsuta committed Jan 18, 2025
1 parent 0b4d116 commit 6f0aa72
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions uber/models/attendee.py
Original file line number Diff line number Diff line change
Expand Up @@ -1149,6 +1149,16 @@ def is_presold_oneday(self):
"""
return self.badge_type_label in c.DAYS_OF_WEEK

@property
def watchlist_warning(self):
"""
Events have different ways of handling people on the attendee watchlist,
so this property allows you to easily override the message shown to staffers
without having to override the entire cannot_check_in_reason function.
"""
regdesk_info_append = " [{}]".format(self.regdesk_info) if self.regdesk_info else ""
return "MUST TALK TO MANAGER before picking up badge{}".format(regdesk_info_append)

@property
def cannot_check_in_reason(self):
"""
Expand All @@ -1158,8 +1168,7 @@ def cannot_check_in_reason(self):

if self.badge_status == c.WATCHED_STATUS:
if self.banned or not self.regdesk_info:
regdesk_info_append = " [{}]".format(self.regdesk_info) if self.regdesk_info else ""
return "MUST TALK TO MANAGER before picking up badge{}".format(regdesk_info_append)
return self.watchlist_warning
return self.regdesk_info or "Badge status is {}".format(self.badge_status_label)

if self.badge_status not in [c.COMPLETED_STATUS, c.NEW_STATUS]:
Expand Down

0 comments on commit 6f0aa72

Please sign in to comment.