From: Radek Czajka Date: Thu, 7 Apr 2022 10:01:15 +0000 (+0200) Subject: fix X-Git-Url: https://git.mdrn.pl/wolnelektury.git/commitdiff_plain/0f14f604bfe3981f2b66726fb69ec0b710150bcc?hp=1076830cbd3a839d1f332100bf3ac6b1fb24c86a fix --- diff --git a/src/catalogue/models/book.py b/src/catalogue/models/book.py index 9de495029..2371103e7 100644 --- a/src/catalogue/models/book.py +++ b/src/catalogue/models/book.py @@ -229,6 +229,8 @@ class Book(models.Model): def is_accessible_to(self, user): if not self.preview: return True + if not user.is_authenticated: + return False Membership = apps.get_model('club', 'Membership') if Membership.is_active_for(user): return True