forked from Github-Mirrors/canaille
adds flash message for user when password compromise investigation failed.
This commit is contained in:
parent
fa3a5f6616
commit
025da08fd3
1 changed files with 7 additions and 0 deletions
|
@ -5,6 +5,7 @@ import re
|
||||||
import wtforms.validators
|
import wtforms.validators
|
||||||
from flask import abort
|
from flask import abort
|
||||||
from flask import current_app
|
from flask import current_app
|
||||||
|
from flask import flash
|
||||||
from flask import make_response
|
from flask import make_response
|
||||||
from flask import request
|
from flask import request
|
||||||
from flask_wtf import FlaskForm
|
from flask_wtf import FlaskForm
|
||||||
|
@ -113,6 +114,12 @@ def compromised_password_validator(form, field):
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
print("Error: " + str(e))
|
print("Error: " + str(e))
|
||||||
if current_app.features.has_smtp and not request_is_htmx():
|
if current_app.features.has_smtp and not request_is_htmx():
|
||||||
|
flash(
|
||||||
|
_(
|
||||||
|
"Password compromise investigation failed. Please contact the administrators."
|
||||||
|
),
|
||||||
|
"error",
|
||||||
|
)
|
||||||
if form.user is not None:
|
if form.user is not None:
|
||||||
user_name = form.user.user_name
|
user_name = form.user.user_name
|
||||||
user_email = form.user.emails[0]
|
user_email = form.user.emails[0]
|
||||||
|
|
Loading…
Reference in a new issue