Display admin email in error message for password reminder

This commit is contained in:
petermaksymo 2021-12-11 22:22:12 -05:00
parent 915c832acc
commit 75a1640c37

View file

@ -363,12 +363,24 @@ def remind_password():
if success:
return redirect(url_for(".password_reminder_sent"))
else:
# Only display admin email if its not the default and public creation is allowed
admin_email = current_app.config.get("MAIL_DEFAULT_SENDER")
error_extension = ""
if (
admin_email
and admin_email[1] != "budget@notmyidea.org"
and current_app.config.get("ALLOW_PUBLIC_PROJECT_CREATION")
):
error_extension = "Contact the administrator at {}.".format(
admin_email[1]
)
flash(
_(
"Sorry, there was an error while sending you an email "
"with password reset instructions. "
"Please check the email configuration of the server "
"or contact the administrator."
"or contact the administrator. {}".format(error_extension)
),
category="danger",
)