mirror of
https://gitlab.archlinux.org/archlinux/aurweb.git
synced 2025-02-03 10:43:03 +01:00
fix: don't check email deliverability when verifying input
For tests, we only care about emails having a valid syntax. I don't think we should verify this at all, as aurweb.scripts.notify will timeout if it cant deliver via sendmail/smtp. Signed-off-by: Kevin Morris <kevr@0cost.org>
This commit is contained in:
parent
16bdbee520
commit
ad1d5a1217
2 changed files with 3 additions and 17 deletions
|
@ -13,7 +13,7 @@ from urllib.parse import urlparse
|
|||
import fastapi
|
||||
import pygit2
|
||||
|
||||
from email_validator import EmailNotValidError, EmailUndeliverableError, validate_email
|
||||
from email_validator import EmailSyntaxError, validate_email
|
||||
from fastapi.responses import JSONResponse
|
||||
|
||||
import aurweb.config
|
||||
|
@ -51,10 +51,8 @@ def valid_username(username):
|
|||
|
||||
def valid_email(email):
|
||||
try:
|
||||
validate_email(email)
|
||||
except EmailUndeliverableError:
|
||||
return False
|
||||
except EmailNotValidError:
|
||||
validate_email(email, check_deliverability=False)
|
||||
except EmailSyntaxError:
|
||||
return False
|
||||
return True
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue