Clear cache on audiobook save.
authorRadek Czajka <radoslaw.czajka@nowoczesnapolska.org.pl>
Fri, 28 Sep 2012 10:42:07 +0000 (12:42 +0200)
committerRadek Czajka <radoslaw.czajka@nowoczesnapolska.org.pl>
Fri, 28 Sep 2012 10:42:07 +0000 (12:42 +0200)
apps/catalogue/models/listeners.py

index 7e034a1..e1299ab 100644 (file)
@@ -44,6 +44,7 @@ def _post_save_handler(sender, instance, **kwargs):
     """ refresh all the short_html stuff on BookMedia update """
     if sender == BookMedia:
         instance.book.save()
     """ refresh all the short_html stuff on BookMedia update """
     if sender == BookMedia:
         instance.book.save()
+        permanent_cache.delete('catalogue.audiobook_list')
     elif sender == Collection:
         permanent_cache.delete('catalogue.collection:%s' % instance.slug)
 post_save.connect(_post_save_handler)
     elif sender == Collection:
         permanent_cache.delete('catalogue.collection:%s' % instance.slug)
 post_save.connect(_post_save_handler)
@@ -51,7 +52,7 @@ post_save.connect(_post_save_handler)
 
 def post_publish(sender, **kwargs):
     permanent_cache.delete_many(['catalogue.book_list',
 
 def post_publish(sender, **kwargs):
     permanent_cache.delete_many(['catalogue.book_list',
-            'catalogue.audiobook_list', 'catalogue.daisy_list'])
+        'catalogue.daisy_list'])
 Book.published.connect(post_publish)
 
 
 Book.published.connect(post_publish)