From 2245baeed5c7fb97da2aeb5441aadf26c280fee9 Mon Sep 17 00:00:00 2001 From: Radek Czajka Date: Thu, 24 Aug 2023 12:53:07 +0200 Subject: [PATCH] fix stats api --- src/catalogue/models.py | 2 +- src/depot/publishers/legimi.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) 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: -- 2.20.1