mirror of
https://github.com/spiral-project/ihatemoney.git
synced 2025-05-05 12:41:49 +02:00
Display admin email in error message for password reminder
This commit is contained in:
parent
915c832acc
commit
75a1640c37
1 changed files with 13 additions and 1 deletions
|
@ -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",
|
||||
)
|
||||
|
|
Loading…
Reference in a new issue