New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Prohibit setting fcpsschools.net as an email #682
Conversation
ensure it is not fcpsschools.net Fixes #599
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One nitpick, and I would recommend adding this to intranet/apps/preferences/views.py
:
@ -52,6 +52,9 @@ def save_personal_info(request, user):
if email_formset.is_valid():
email_formset.save()
else:
+ for error in email_formset.errors:
+ if isinstance(error.get("address"), list):
+ errors.append(error["address"][0])
errors.append('Could not set emails.')
if website_formset.is_valid():
website_formset.save()
Tested locally, it makes the ValidationError
's error message ("You cannot provide an fcpsschools.net address.") appear as a notification, which makes it more obvious to the user what's going on.
through email_formset to user
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Blocks users from setting an
fcpsschools.net
address via preferences.Fixes #599