Fixes
authorRadek Czajka <rczajka@rczajka.pl>
Fri, 8 Jul 2022 09:42:26 +0000 (11:42 +0200)
committerRadek Czajka <rczajka@rczajka.pl>
Fri, 8 Jul 2022 09:42:26 +0000 (11:42 +0200)
requirements/requirements.txt
src/alerts/models.py
src/documents/ebook_utils.py

index 2d3966c..d95985b 100644 (file)
@@ -10,7 +10,7 @@ python-slugify
 python-docx==0.8.10
 Wikidata==0.6.1
 
 python-docx==0.8.10
 Wikidata==0.6.1
 
-librarian==2.4.4
+librarian==2.4.5
 
 ## Django
 Django==3.2.14
 
 ## Django
 Django==3.2.14
index 132531f..a262980 100644 (file)
@@ -39,4 +39,5 @@ class Alert(models.Model):
 
 @receiver(post_commit)
 def validate_post_commit(sender, **kwargs):
 
 @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)
index 9253d59..c5a758f 100644 (file)
@@ -14,6 +14,7 @@ class RedakcjaDocProvider(DocProvider):
         self.publishable = publishable
 
     def by_slug(self, slug):
         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'))
         return BytesIO(Book.objects.get(catalogue_book_id=slug
                     ).materialize(publishable=self.publishable
                     ).encode('utf-8'))