mirror of
https://github.com/spiral-project/ihatemoney.git
synced 2025-05-04 20:21:49 +02:00
utils: improve error message when form field validation fails
This commit is contained in:
parent
9b01f69e5c
commit
b09b9c1629
1 changed files with 3 additions and 1 deletions
|
@ -454,7 +454,9 @@ def format_form_errors(form, prefix):
|
||||||
)
|
)
|
||||||
else:
|
else:
|
||||||
error_list = "</li><li>".join(
|
error_list = "</li><li>".join(
|
||||||
str(error) for (field, errors) in form.errors.items() for error in errors
|
f"<strong>{field}</strong> {error}"
|
||||||
|
for (field, errors) in form.errors.items()
|
||||||
|
for error in errors
|
||||||
)
|
)
|
||||||
errors = f"<ul><li>{error_list}</li></ul>"
|
errors = f"<ul><li>{error_list}</li></ul>"
|
||||||
# I18N: Form error with a list of errors
|
# I18N: Form error with a list of errors
|
||||||
|
|
Loading…
Reference in a new issue