From: Radek Czajka Date: Thu, 3 Aug 2023 15:33:24 +0000 (+0200) Subject: more X-Git-Url: https://git.mdrn.pl/wolnelektury.git/commitdiff_plain/d9cece3698e91c621a933cf9bd93b8b4bd207dfe?ds=sidebyside more --- diff --git a/src/catalogue/models/fragment.py b/src/catalogue/models/fragment.py index fe9355a8a..7eca8556f 100644 --- a/src/catalogue/models/fragment.py +++ b/src/catalogue/models/fragment.py @@ -39,13 +39,6 @@ class Fragment(models.Model): """Returns short version of the fragment.""" return self.short_text if self.short_text else self.text - @cached_render('catalogue/fragment_promo.html') - def promo_box(self): - return {'fragment': self} - @property def themes(self): return self.tags.filter(category='theme') - - def clear_cache(self): - clear_cached_renders(self.promo_box) diff --git a/src/catalogue/signals.py b/src/catalogue/signals.py index 81c0b9ce6..209ab41ac 100644 --- a/src/catalogue/signals.py +++ b/src/catalogue/signals.py @@ -67,11 +67,6 @@ def tag_after_change(sender, instance, **kwargs): for model_instance in model.tagged.with_all([instance]).only('pk'): model_instance.clear_cache() - if instance.category == 'author': - for model in Fragment, PictureArea: - for model_instance in model.tagged.with_all([instance]).only('pk'): - model_instance.clear_cache() - @receiver(tags_updated) def receive_tags_updated(sender, instance, affected_tags, **kwargs): diff --git a/src/catalogue/templates/catalogue/fragment_promo.html b/src/catalogue/templates/catalogue/fragment_promo.html deleted file mode 100644 index fc8de0cf6..000000000 --- a/src/catalogue/templates/catalogue/fragment_promo.html +++ /dev/null @@ -1,8 +0,0 @@ -{% if fragment %} - -
- {{ fragment.get_short_text|safe }} -
-

{{ fragment.book.pretty_title }}

-
-{% endif %}