mirror of
https://github.com/Hopiu/wagtail.git
synced 2026-04-17 13:31:01 +00:00
Pass image_id into confirmation.json (as it was before)
This is because when the image is deleted, the ID gets unassigned. So "None" gets inserted into the response JSON.
This commit is contained in:
parent
98db7956f2
commit
0cfc4ae94b
2 changed files with 4 additions and 3 deletions
|
|
@ -1,5 +1,5 @@
|
|||
{
|
||||
"image_id": {{ image.id }},
|
||||
"image_id": {{ image_id }},
|
||||
{% if form %}
|
||||
"form": "{% filter escapejs %}{% include 'wagtailimages/multiple/edit_form.html' %}{% endfilter %}",
|
||||
{% endif %}
|
||||
|
|
|
|||
|
|
@ -56,11 +56,12 @@ def edit(request, image_id, callback=None):
|
|||
form.save()
|
||||
return render(request, 'wagtailimages/multiple/confirmation.json', {
|
||||
'success': True,
|
||||
'image': image,
|
||||
'image_id': image_id,
|
||||
}, content_type='application/json')
|
||||
else:
|
||||
return render(request, 'wagtailimages/multiple/confirmation.json', {
|
||||
'success': False,
|
||||
'image_id': image_id,
|
||||
'image': image,
|
||||
'form': form,
|
||||
}, content_type='application/json')
|
||||
|
|
@ -81,6 +82,6 @@ def delete(request, image_id):
|
|||
|
||||
return render(request, 'wagtailimages/multiple/confirmation.json', {
|
||||
'success': True,
|
||||
'image': image,
|
||||
'image_id': image_id,
|
||||
}, content_type='application/json')
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue