mirror of
https://github.com/Hopiu/wagtail.git
synced 2026-05-11 16:53:10 +00:00
Show clean model errors on edit also
This commit is contained in:
parent
e4c38302e0
commit
a40c71687d
1 changed files with 5 additions and 1 deletions
|
|
@ -279,7 +279,11 @@ def edit(request, page_id):
|
|||
|
||||
return redirect('wagtailadmin_explore', page.get_parent().id)
|
||||
else:
|
||||
messages.error(request, _("The page could not be saved due to validation errors"))
|
||||
if form.errors and form.errors.get('__all__'):
|
||||
messages.error(request, _("The page could not be saved: ") + ', '.join(form.errors['__all__']))
|
||||
else:
|
||||
messages.error(request, _("The page could not be saved due to validation errors"))
|
||||
|
||||
edit_handler = edit_handler_class(instance=page, form=form)
|
||||
errors_debug = (
|
||||
repr(edit_handler.form.errors)
|
||||
|
|
|
|||
Loading…
Reference in a new issue