From 1c93933119a88d4f83f6bebac0e3c4ffc4c130e2 Mon Sep 17 00:00:00 2001 From: Gertjan van den Burg Date: Mon, 20 May 2019 14:23:39 -0400 Subject: Bugfix for registration email restriction --- app/auth/forms.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'app/auth') diff --git a/app/auth/forms.py b/app/auth/forms.py index 06bad3f..5bff46f 100644 --- a/app/auth/forms.py +++ b/app/auth/forms.py @@ -42,7 +42,10 @@ class RegistrationForm(FlaskForm): if email.data in current_app.config["USER_EMAILS"]: return if current_app.config["USER_EMAIL_DOMAINS"]: - if not email.data in current_app.config["USER_EMAIL_DOMAINS"]: + if ( + not email.data.split("@")[-1] + in current_app.config["USER_EMAIL_DOMAINS"] + ): raise ValidationError( "Access to AnnotateChange is restricted to " "individuals with email addresses from specific " -- cgit v1.2.3