mirror of
https://github.com/jazzband/django-authority.git
synced 2026-05-05 06:04:45 +00:00
Show action form errors using message_user
Not very neat, but way better than nothing when there are errors (previously the error was invisible and the action simply seemed to have completed).
This commit is contained in:
parent
8c8e478a31
commit
423bb90c71
1 changed files with 4 additions and 0 deletions
|
|
@ -87,6 +87,10 @@ def edit_permissions(modeladmin, request, queryset):
|
|||
if all_valid(formsets):
|
||||
for formset in formsets:
|
||||
formset.save()
|
||||
else:
|
||||
modeladmin.message_user(request, '; '.join(
|
||||
err.as_text() for formset in formsets for err in formset.errors
|
||||
))
|
||||
# redirect to full request path to make sure we keep filter
|
||||
return HttpResponseRedirect(request.get_full_path())
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue