SuffolkLITLab / docassemble-GithubFeedbackForm

A docassemble extension.
MIT License
1 stars 0 forks source link

Fix logged-out user crash (user_info().email) #24

Closed BryceStevenWilley closed 2 years ago

BryceStevenWilley commented 2 years ago

When debug is false (only on the production server usually), we sometimes ask for the users email if they want to join a feedback panel, defaulting to the user's email when they are logged in.

However, if the user isn't logged in, user_info()'s return value doesn't have an email attribute, resulting in an error. This falls back to defaulting nothing for the field.

That default code is a mako block, so it is evaluated before the show if on the actual field, meaining it will break the interview, even if the panel question is disabled.

Fixes #23.

Tested locally by running the feedback interview in a private window with debug: False in the config.