more
authorRadek Czajka <rczajka@rczajka.pl>
Thu, 3 Aug 2023 15:33:24 +0000 (17:33 +0200)
committerRadek Czajka <rczajka@rczajka.pl>
Thu, 3 Aug 2023 15:33:24 +0000 (17:33 +0200)
src/catalogue/models/fragment.py
src/catalogue/signals.py
src/catalogue/templates/catalogue/fragment_promo.html [deleted file]

index fe9355a..7eca855 100644 (file)
@@ -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)
index 81c0b9c..209ab41 100644 (file)
@@ -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 (file)
index fc8de0c..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-{% if fragment %}
-  <a href="{{ fragment.get_absolute_url }}" class="cite">
-    <blockquote class="cite-body">
-      {{ fragment.get_short_text|safe }}
-    </blockquote>
-    <p class="mono source">{{ fragment.book.pretty_title }}</p>
-  </a>
-{% endif %}