forked from Github-Mirrors/canaille
fix: do not attempt to configure email_validator if absent
This commit is contained in:
parent
3ecda0ceab
commit
91c82dad4d
1 changed files with 2 additions and 1 deletions
|
@ -126,10 +126,11 @@ def compromised_password_validator(form, field):
|
|||
def email_validator(form, field):
|
||||
try:
|
||||
import email_validator # noqa: F401
|
||||
|
||||
email_validator.TEST_ENVIRONMENT = current_app.config.get("TESTING", False)
|
||||
except ImportError:
|
||||
pass
|
||||
|
||||
email_validator.TEST_ENVIRONMENT = current_app.config.get("TESTING", False)
|
||||
wtforms.validators.Email()(form, field)
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue