Skip to content

Commit e1a6d8a

Browse files
devjackclaude
andcommitted
Treat an absent East Asian name order answer as unset
Pretix omits unticked boolean answers from a position's answer list entirely, rather than sending them with a false value. generate_nickname subscripted "east_asian_name_order" directly, so any order whose holder left that checkbox unticked raised KeyError. The exception escaped to the 500 handler, so /join returned the error page instead of redirecting into the Discord OAuth2 flow. This affected every attendee who supplied a name and did not tick the box. Read the answer with .get() so an absent value falls through to the default name ordering, which is the intended behaviour when East Asian name order has not been requested. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
1 parent 9af158e commit e1a6d8a

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/precord/values.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ def generate_nickname(answers: dict[str, Any]) -> str | None:
5454
"""Generate the nickname to use on the server based on answers in the order."""
5555
if "primary_name" not in answers:
5656
return None
57-
if answers["east_asian_name_order"] == "True":
57+
if answers.get("east_asian_name_order") == "True":
5858
return f"{answers.get('additional_names', '')} {answers['primary_name']}"
5959
return f"{answers['primary_name']} {answers.get('additional_names', '')}"
6060

0 commit comments

Comments
 (0)