diff options
| -rw-r--r-- | CHANGELOG.md | 4 | ||||
| -rw-r--r-- | app/__init__.py | 2 | ||||
| -rw-r--r-- | app/auth/forms.py | 5 | ||||
| -rw-r--r-- | config.py | 4 |
4 files changed, 11 insertions, 4 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md index b8c4826..c2c5bf8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Changelog +## Version 0.1.5 + +* Bugfix for registration restriction + ## Version 0.1.4 * Bugfix for admin annotation view diff --git a/app/__init__.py b/app/__init__.py index b5de772..864de2b 100644 --- a/app/__init__.py +++ b/app/__init__.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- -__version__ = "0.1.4" +__version__ = "0.1.5" import logging import os 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 " @@ -54,11 +54,11 @@ class Config(object): # user emails allowed USER_EMAIL_DOMAINS = os.environ.get("USER_EMAIL_DOMAINS") or "" USER_EMAIL_DOMAINS = [ - x.split() for x in USER_EMAIL_DOMAINS.split(";") + x.strip() for x in USER_EMAIL_DOMAINS.split(";") if x.strip() ] USER_EMAIL_DOMAINS = ( None if not USER_EMAIL_DOMAINS else USER_EMAIL_DOMAINS ) USER_EMAILS = os.environ.get("USER_EMAILS") or "" - USER_EMAILS = [x.split() for x in USER_EMAILS.split(";")] + USER_EMAILS = [x.strip() for x in USER_EMAILS.split(";") if x.strip()] USER_EMAILS = None if not USER_EMAILS else USER_EMAILS |
