Add Book.ancestor m2m.
[wolnelektury.git] / apps / catalogue / models / listeners.py
index b7c5d55..031c4f1 100644 (file)
@@ -15,25 +15,6 @@ from newtagging.models import tags_updated
 permanent_cache = caches['permanent']
 
 
-def _tags_updated_handler(sender, affected_tags, **kwargs):
-    # reset tag global counter
-    # we want Tag.changed_at updated for API to know the tag was touched
-    for tag in affected_tags:
-        tasks.touch_tag(tag)
-
-    # if book tags changed, reset book tag counter
-    if isinstance(sender, Book) and \
-                Tag.objects.filter(pk__in=(tag.pk for tag in affected_tags)).\
-                    exclude(category__in=('book', 'theme', 'set')).count():
-        sender.reset_tag_counter()
-    # if fragment theme changed, reset book theme counter
-    elif isinstance(sender, Fragment) and \
-                Tag.objects.filter(pk__in=(tag.pk for tag in affected_tags)).\
-                    filter(category='theme').count():
-        sender.book.reset_theme_counter()
-tags_updated.connect(_tags_updated_handler)
-
-
 def _pre_delete_handler(sender, instance, **kwargs):
     """ refresh Book on BookMedia delete """
     if sender == BookMedia: