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:
Karl Hobley 2014-07-15 17:00:59 +01:00
parent 0fe9d74efc
commit f96529ece9
2 changed files with 4 additions and 0 deletions

View file

@ -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 %}
}

View file

@ -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')