From 92d4704c889df1405c4d2c34e1fce5e5c1ced680 Mon Sep 17 00:00:00 2001 From: Radek Czajka Date: Fri, 8 Jul 2022 11:42:26 +0200 Subject: [PATCH 1/1] Fixes --- requirements/requirements.txt | 2 +- src/alerts/models.py | 3 ++- src/documents/ebook_utils.py | 1 + 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/requirements/requirements.txt b/requirements/requirements.txt index 2d3966c4..d95985b9 100644 --- a/requirements/requirements.txt +++ b/requirements/requirements.txt @@ -10,7 +10,7 @@ python-slugify python-docx==0.8.10 Wikidata==0.6.1 -librarian==2.4.4 +librarian==2.4.5 ## Django Django==3.2.14 diff --git a/src/alerts/models.py b/src/alerts/models.py index 132531fd..a262980c 100644 --- a/src/alerts/models.py +++ b/src/alerts/models.py @@ -39,4 +39,5 @@ class Alert(models.Model): @receiver(post_commit) def validate_post_commit(sender, **kwargs): - Alert.validate_book(sender.tree.book) + if hasattr(sender.tree, 'book'): + Alert.validate_book(sender.tree.book) diff --git a/src/documents/ebook_utils.py b/src/documents/ebook_utils.py index 9253d59f..c5a758f1 100644 --- a/src/documents/ebook_utils.py +++ b/src/documents/ebook_utils.py @@ -14,6 +14,7 @@ class RedakcjaDocProvider(DocProvider): self.publishable = publishable def by_slug(self, slug): + print(slug) return BytesIO(Book.objects.get(catalogue_book_id=slug ).materialize(publishable=self.publishable ).encode('utf-8')) -- 2.20.1