From: Radek Czajka Date: Thu, 24 Aug 2023 10:53:07 +0000 (+0200) Subject: fix stats api X-Git-Url: https://git.mdrn.pl/redakcja.git/commitdiff_plain/2245baeed5c7fb97da2aeb5441aadf26c280fee9?ds=sidebyside fix stats api --- diff --git a/src/catalogue/models.py b/src/catalogue/models.py index 38d31678..fb42ba89 100644 --- a/src/catalogue/models.py +++ b/src/catalogue/models.py @@ -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 diff --git a/src/depot/publishers/legimi.py b/src/depot/publishers/legimi.py index dbfd71ea..2b535f92 100644 --- a/src/depot/publishers/legimi.py +++ b/src/depot/publishers/legimi.py @@ -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: