X-Git-Url: https://git.mdrn.pl/wolnelektury.git/blobdiff_plain/552f54f1b01bd2bcc0bc83e5d24466086a863efa..19b6808a73f77fffdbb80d049dd1f8d81eec9d78:/apps/catalogue/views.py?ds=sidebyside diff --git a/apps/catalogue/views.py b/apps/catalogue/views.py index de2c17b28..5be5122bd 100644 --- a/apps/catalogue/views.py +++ b/apps/catalogue/views.py @@ -500,7 +500,7 @@ def book_sets(request, slug): book.tags = new_shelves + list(book.tags.filter(~Q(category='set') | ~Q(user=request.user))) if request.is_ajax(): - return HttpResponse(_('

Shelves were sucessfully saved.

')) + return JSONResponse('{"msg":"'+_("

Shelves were sucessfully saved.

")+'", "after":"close"}') else: return HttpResponseRedirect('/') else: @@ -634,7 +634,7 @@ def new_set(request): new_set = new_set_form.save(request.user) if request.is_ajax(): - return HttpResponse(_('

Shelf %s was successfully created

') % new_set) + return JSONResponse('{"id":"%d", "name":"%s", "msg":"

Shelf %s was successfully created

"}' % (new_set.id, new_set.name, new_set)) else: return HttpResponseRedirect('/')