X-Git-Url: https://git.mdrn.pl/wolnelektury.git/blobdiff_plain/141f3bea77fdb337069c198ffeee870696f4554e..cf76dbd53927cb38154845748fb3481cf013970f:/src/social/utils.py?ds=sidebyside diff --git a/src/social/utils.py b/src/social/utils.py old mode 100755 new mode 100644 index 52fd4e443..6ab303abf --- a/src/social/utils.py +++ b/src/social/utils.py @@ -1,6 +1,5 @@ -# -*- 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. +# This file is part of Wolne Lektury, licensed under GNU Affero GPLv3 or later. +# Copyright © Fundacja Wolne Lektury. See NOTICE for more information. # from collections import defaultdict from random import randint @@ -15,7 +14,7 @@ from social.models import Cite def likes(user, work, request=None): - if not user.is_authenticated(): + if not user.is_authenticated: return False if request is None: @@ -115,7 +114,7 @@ def choose_cite(book_id=None, tag_ids=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)