From 0f14f604bfe3981f2b66726fb69ec0b710150bcc Mon Sep 17 00:00:00 2001 From: Radek Czajka Date: Thu, 7 Apr 2022 12:01:15 +0200 Subject: [PATCH] fix --- src/catalogue/models/book.py | 2 ++ 1 file changed, 2 insertions(+) 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 -- 2.20.1