X-Git-Url: https://git.mdrn.pl/wolnelektury.git/blobdiff_plain/1076830cbd3a839d1f332100bf3ac6b1fb24c86a..df60910b2d457f031cbe0a153e51e7378c0165d8:/src/catalogue/models/book.py?ds=sidebyside 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