X-Git-Url: https://git.mdrn.pl/wolnelektury.git/blobdiff_plain/4e7302190468a80e5cd558cc4c73985b16153e0a..0c0d8f5f4a9cfe0c5af038cf0f1c5637a13d1141:/apps/catalogue/views.py?ds=sidebyside diff --git a/apps/catalogue/views.py b/apps/catalogue/views.py index aa3e3c662..2a11f4bb5 100644 --- a/apps/catalogue/views.py +++ b/apps/catalogue/views.py @@ -455,13 +455,13 @@ def user_shelves(request): @cache.never_cache def book_sets(request, slug): + if not request.user.is_authenticated(): + return HttpResponse(_('
To maintain your shelves you need to be logged in.
')) + book = get_object_or_404(models.Book, slug=slug) user_sets = models.Tag.objects.filter(category='set', user=request.user) book_sets = book.tags.filter(category='set', user=request.user) - if not request.user.is_authenticated(): - return HttpResponse(_('To maintain your shelves you need to be logged in.
')) - if request.method == 'POST': form = forms.ObjectSetsForm(book, request.user, request.POST) if form.is_valid():