mirror of
https://github.com/spiral-project/ihatemoney.git
synced 2025-05-05 12:41:49 +02:00
Integrated PR feedback for code clarity
This commit is contained in:
parent
74280d40c1
commit
ee3c62c665
1 changed files with 5 additions and 10 deletions
|
@ -52,21 +52,16 @@ def flash_email_error(error_message, category="danger"):
|
||||||
admin email as a contact if MAIL_DEFAULT_SENDER is set to not the
|
admin email as a contact if MAIL_DEFAULT_SENDER is set to not the
|
||||||
default value and SHOW_ADMIN_EMAIL is True.
|
default value and SHOW_ADMIN_EMAIL is True.
|
||||||
"""
|
"""
|
||||||
admin_email = current_app.config.get("MAIL_DEFAULT_SENDER")
|
(admin_name, admin_email) = current_app.config.get("MAIL_DEFAULT_SENDER")
|
||||||
error_extension = "."
|
error_extension = "."
|
||||||
if (
|
if admin_email != "admin@example.com" and current_app.config.get(
|
||||||
admin_email
|
"SHOW_ADMIN_EMAIL"
|
||||||
and admin_email[1] != "admin@example.com"
|
|
||||||
and current_app.config.get("SHOW_ADMIN_EMAIL")
|
|
||||||
):
|
):
|
||||||
error_extension = " or contact the administrator at {}.".format(admin_email[1])
|
error_extension = f" or contact the administrator at {admin_email}."
|
||||||
|
|
||||||
flash(
|
flash(
|
||||||
_(
|
_(
|
||||||
error_message
|
f"{error_message} Please check the email configuration of the server{error_extension}"
|
||||||
+ " Please check the email configuration of the server {}".format(
|
|
||||||
error_extension
|
|
||||||
)
|
|
||||||
),
|
),
|
||||||
category=category,
|
category=category,
|
||||||
)
|
)
|
||||||
|
|
Loading…
Reference in a new issue