Skip to content
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

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open

Validate UoE emails #51

wants to merge 3 commits into from

Conversation

Dominko
Copy link
Contributor

@Dominko Dominko commented Nov 3, 2024

A simple check to filter out UoE email addresses during applications

Copy link

@bjin96 bjin96 left a 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_@.+-]*')


Copy link

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):
Copy link

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:
Copy link

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants