diff --git a/ihatemoney/web.py b/ihatemoney/web.py index d9e7ec08..1dd6d660 100644 --- a/ihatemoney/web.py +++ b/ihatemoney/web.py @@ -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", )