mirror of
https://github.com/spiral-project/ihatemoney.git
synced 2025-04-28 09:22:38 +02:00
utils: improve error message when form field validation fails
This commit is contained in:
parent
9a834c97e3
commit
967266f7dc
1 changed files with 3 additions and 1 deletions
|
@ -452,7 +452,9 @@ def format_form_errors(form, prefix):
|
|||
)
|
||||
else:
|
||||
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>"
|
||||
# I18N: Form error with a list of errors
|
||||
|
|
Loading…
Reference in a new issue