-
Notifications
You must be signed in to change notification settings - Fork 4
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
Validate UoE emails #51
base: main
Are you sure you want to change the base?
Conversation
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.
Works for me and looks good. See comment regarding edge case :)
@@ -17,7 +17,6 @@ | |||
|
|||
data_re = re.compile('[ a-zA-Z0-9_@.+-]*') | |||
|
|||
|
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.
Revert?
@@ -5,6 +5,12 @@ | |||
from home.models import Point, WgUpdate, Minutes | |||
from users.models import Profile | |||
|
|||
def validate_uoe_mail(value): |
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.
is_university_email
or similar might be more intuitive naming, e.g. leads to if not is_university_email() ...
.
@@ -5,6 +5,12 @@ | |||
from home.models import Point, WgUpdate, Minutes | |||
from users.models import Profile | |||
|
|||
def validate_uoe_mail(value): | |||
if "ac.uk" in value: |
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.
More of an edge case, but if value.endswith('ac.uk')
might be better in case some one with an email similar to [email protected]
will be able to sign up.
In case you change this just a heads up if value.endswith('ac.uk')
will crash if value is None
but I assume that can't happen?
A simple check to filter out UoE email addresses during applications