X-Git-Url: https://git.mdrn.pl/wolnelektury.git/blobdiff_plain/4e361d55331351f56077e5f9999ecb4ee7e93819..9c2555ad140dca1c09cde628bd22aac811e05b7e:/src/social/views.py?ds=sidebyside diff --git a/src/social/views.py b/src/social/views.py index b7c823373..89661590e 100644 --- a/src/social/views.py +++ b/src/social/views.py @@ -10,6 +10,7 @@ from ajaxable.utils import AjaxableFormView from catalogue.models import Book from social import forms +from wolnelektury.utils import is_ajax # ==================== @@ -25,7 +26,7 @@ def like_book(request, slug): book.like(request.user) - if request.is_ajax(): + if is_ajax(request): return JsonResponse({"success": True, "msg": "ok", "like": True}) else: return redirect(book) @@ -39,7 +40,7 @@ def unlike_book(request, slug): book.unlike(request.user) - if request.is_ajax(): + if is_ajax(request): return JsonResponse({"success": True, "msg": "ok", "like": False}) else: return redirect(book)