mirror of
https://github.com/Hopiu/wagtail.git
synced 2026-05-01 20:14:55 +00:00
Pass image object instead of image id into confirmation.json
This commit is contained in:
parent
062f027bc3
commit
0fe9d74efc
2 changed files with 5 additions and 5 deletions
|
|
@ -1,4 +1,4 @@
|
|||
{
|
||||
"image_id": {{ image_id }},
|
||||
"image_id": {{ image.id }},
|
||||
"success": {% if success %}true{% else %}false{% endif %}
|
||||
}
|
||||
|
|
@ -51,12 +51,12 @@ def edit(request, image_id, callback=None):
|
|||
form.save()
|
||||
return render(request, 'wagtailimages/multiple/confirmation.json', {
|
||||
'success': True,
|
||||
'image_id': image_id
|
||||
'image': image,
|
||||
}, content_type='application/json')
|
||||
|
||||
return render(request, 'wagtailimages/multiple/confirmation.json', {
|
||||
'success': False,
|
||||
'image_id': image_id
|
||||
'image': image,
|
||||
}, content_type='application/json')
|
||||
|
||||
|
||||
|
|
@ -71,10 +71,10 @@ def delete(request, image_id):
|
|||
image.delete()
|
||||
return render(request, 'wagtailimages/multiple/confirmation.json', {
|
||||
'success': True,
|
||||
'image_id': image_id
|
||||
'image': image,
|
||||
}, content_type='application/json')
|
||||
else:
|
||||
return render(request, 'wagtailimages/multiple/confirmation.json', {
|
||||
'success': False,
|
||||
'image_id': image_id
|
||||
'image': image,
|
||||
}, content_type='application/json')
|
||||
|
|
|
|||
Loading…
Reference in a new issue