DAISY cache fix
authorRadek Czajka <radoslaw.czajka@nowoczesnapolska.org.pl>
Mon, 1 Oct 2012 08:54:04 +0000 (10:54 +0200)
committerRadek Czajka <radoslaw.czajka@nowoczesnapolska.org.pl>
Mon, 1 Oct 2012 08:54:04 +0000 (10:54 +0200)
apps/catalogue/models/listeners.py

index e1299ab..93ad2d7 100644 (file)
@@ -44,15 +44,15 @@ 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')
+        permanent_cache.delete_many([
+            'catalogue.audiobook_list', 'catalogue.daisy_list'])
     elif sender == Collection:
         permanent_cache.delete('catalogue.collection:%s' % instance.slug)
 post_save.connect(_post_save_handler)
 
 
 def post_publish(sender, **kwargs):
     elif sender == Collection:
         permanent_cache.delete('catalogue.collection:%s' % instance.slug)
 post_save.connect(_post_save_handler)
 
 
 def post_publish(sender, **kwargs):
-    permanent_cache.delete_many(['catalogue.book_list',
-        'catalogue.daisy_list'])
+    permanent_cache.delete('catalogue.book_list')
 Book.published.connect(post_publish)
 
 
 Book.published.connect(post_publish)