-# -*- coding: utf-8 -*-
# This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later.
# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information.
#
def likes(user, work, request=None):
- if not user.is_authenticated():
+ if not user.is_authenticated:
return False
if request is None:
def get_or_choose_cite(request, book_id=None, tag_ids=None):
try:
assert request.user.is_staff
- assert 'choose_cite' in request.GET
- return Cite.objects.get(pk=request.GET['choose_cite'])
+ assert 'banner' in request.GET
+ return Cite.objects.get(pk=request.GET['banner'])
except (AssertionError, Cite.DoesNotExist):
return choose_cite(book_id, tag_ids)