fix: display a 500 error when SMTP configuration is defined but null

this improves tests coverage
This commit is contained in:
Éloi Rivard 2024-09-15 17:57:30 +02:00
parent c5317b7f5b
commit c28a1e9351
No known key found for this signature in database
GPG key ID: 7EDA204EA57DD184

View file

@ -94,7 +94,7 @@ def smtp_needed():
def wrapper(view_function):
@wraps(view_function)
def decorator(*args, **kwargs):
if "SMTP" in current_app.config["CANAILLE"]:
if current_app.config["CANAILLE"].get("SMTP"):
return view_function(*args, **kwargs)
message = _("No SMTP server has been configured")