X-Git-Url: https://git.mdrn.pl/wolnelektury.git/blobdiff_plain/68f21622eb28525d849d34df21882714818c95ce..ca8f4e8fef80cb603117ed579da8554f503698e5:/src/catalogue/fields.py diff --git a/src/catalogue/fields.py b/src/catalogue/fields.py index 94bdb6097..9c5696fa6 100644 --- a/src/catalogue/fields.py +++ b/src/catalogue/fields.py @@ -251,10 +251,13 @@ class PdfField(EbookField): @staticmethod def transform(wldoc, book): + MediaInsertSet = apps.get_model('annoy', 'MediaInsertSet') return wldoc.as_pdf( morefloats=settings.LIBRARIAN_PDF_MOREFLOATS, cover=get_make_cover(book), - base_url=absolute_url(gallery_url(wldoc.book_info.url.slug)), customizations=['notoc']) + base_url=absolute_url(gallery_url(wldoc.book_info.url.slug)), customizations=['notoc'], + fundraising=MediaInsertSet.get_texts_for('pdf'), + ) def build(self, fieldfile): super().build(fieldfile) @@ -347,7 +350,6 @@ class HtmlField(EbookField): tag.name = theme_name setattr(tag, "name_%s" % lang, theme_name) tag.sort_key = sortify(theme_name.lower()) - tag.for_books = True tag.save() themes.append(tag) elif lang is not None: @@ -377,10 +379,6 @@ class HtmlField(EbookField): new_fragment.save() new_fragment.tags = set(meta_tags + themes) - for theme in themes: - if not theme.for_books: - theme.for_books = True - theme.save() book.html_built.send(sender=type(self), instance=book) return True return False