fix stats api
authorRadek Czajka <rczajka@rczajka.pl>
Thu, 24 Aug 2023 10:53:07 +0000 (12:53 +0200)
committerRadek Czajka <rczajka@rczajka.pl>
Thu, 24 Aug 2023 10:53:07 +0000 (12:53 +0200)
src/catalogue/models.py
src/depot/publishers/legimi.py

index 38d3167..fb42ba8 100644 (file)
@@ -397,7 +397,7 @@ class Book(WikidataModel):
         if hasattr(self, '_content_stats'):
             return self._content_stats
         try:
-            stats = self.document_books.first().wldocument().get_statistics()['total']
+            stats = self.document_books.first().wldocument(librarian2=True).get_statistics()['total']
         except Exception as e:
             stats = {}
         self._content_stats = stats
index dbfd71e..2b535f9 100644 (file)
@@ -356,7 +356,7 @@ class Legimi(BasePublisher):
     def edit_sale(self, book):
         assert book.legimi_id
 
-        words = book.wldocument().get_statistics()['total']['words_with_fn']
+        words = book.wldocument(librarian2=True).get_statistics()['total']['words_with_fn']
 
         price = settings.LEGIMI_SMALL_PRICE
         if words > settings.LEGIMI_SMALL_WORDS: