Skip to content
Snippets Groups Projects

fix email verification issues

Merged Kevin Morris requested to merge kevr/aurweb:fix-email-validator into master
4 files
+ 180
197
Compare changes
  • Side-by-side
  • Inline
Files
4
+ 3
5
@@ -13,7 +13,7 @@ from urllib.parse import urlparse
@@ -13,7 +13,7 @@ from urllib.parse import urlparse
import fastapi
import fastapi
import pygit2
import pygit2
from email_validator import EmailNotValidError, EmailUndeliverableError, validate_email
from email_validator import EmailSyntaxError, validate_email
from fastapi.responses import JSONResponse
from fastapi.responses import JSONResponse
import aurweb.config
import aurweb.config
@@ -51,10 +51,8 @@ def valid_username(username):
@@ -51,10 +51,8 @@ def valid_username(username):
def valid_email(email):
def valid_email(email):
try:
try:
validate_email(email)
validate_email(email, check_deliverability=False)
except EmailUndeliverableError:
except EmailSyntaxError:
return False
except EmailNotValidError:
return False
return False
return True
return True
Loading