refactor: PEP20 flat is better than nested

This commit is contained in:
Éloi Rivard 2024-11-20 14:27:18 +01:00
parent b0e38b6f71
commit 6fa86cb5b2
No known key found for this signature in database
GPG key ID: 7EDA204EA57DD184

View file

@ -6,7 +6,12 @@ from canaille.core.mails import send_compromised_password_check_failure_mail
def check_if_send_mail_to_admins(form, api_url, hashed_password_suffix):
if current_app.features.has_smtp and current_app.config["CANAILLE"]["ADMIN_EMAIL"]:
if (
not current_app.features.has_smtp
or not current_app.config["CANAILLE"]["ADMIN_EMAIL"]
):
return
flash(
_(
"Password compromise investigation failed. "