mirror of
https://github.com/Hopiu/wagtail.git
synced 2026-05-04 21:44:44 +00:00
Send back form on validation error of multi image uploader
This allows validations errors to be displayed on the frontend
This commit is contained in:
parent
0fe9d74efc
commit
f96529ece9
2 changed files with 4 additions and 0 deletions
|
|
@ -1,4 +1,7 @@
|
|||
{
|
||||
"image_id": {{ image.id }},
|
||||
{% if form %}
|
||||
"form": "{% filter escapejs %}{% include 'wagtailimages/multiple/edit_form.html' %}{% endfilter %}",
|
||||
{% endif %}
|
||||
"success": {% if success %}true{% else %}false{% endif %}
|
||||
}
|
||||
|
|
@ -57,6 +57,7 @@ def edit(request, image_id, callback=None):
|
|||
return render(request, 'wagtailimages/multiple/confirmation.json', {
|
||||
'success': False,
|
||||
'image': image,
|
||||
'form': form,
|
||||
}, content_type='application/json')
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue