Fix linter

This commit is contained in:
yatesdr 2024-10-23 16:08:51 -04:00 committed by GitHub
parent d4381440a9
commit 6c7dacf77a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -10,10 +10,10 @@ class MyAccountAdapter(DefaultAccountAdapter):
return settings.SSL_FRONTEND_HOST + url
def clean_email(self, email):
if hasattr(settings,"ALLOWED_DOMAINS_FOR_USER_REGISTRATION") and settings.ALLOWED_DOMAINS_FOR_USER_REGISTRATION:
if hasattr(settings, "ALLOWED_DOMAINS_FOR_USER_REGISTRATION") and settings.ALLOWED_DOMAINS_FOR_USER_REGISTRATION:
if email.split("@")[1] not in settings.ALLOWED_DOMAINS_FOR_USER_REGISTRATION:
raise ValidationError("Domain is not in the permitted list")
if email.split("@")[1] in settings.RESTRICTED_DOMAINS_FOR_USER_REGISTRATION:
raise ValidationError("Domain is restricted from registering")
return email