From: Radek Czajka Date: Fri, 28 Sep 2012 10:42:07 +0000 (+0200) Subject: Clear cache on audiobook save. X-Git-Url: https://git.mdrn.pl/wolnelektury.git/commitdiff_plain/9f342387ccdbf24bbf78a6f374738607de6de974 Clear cache on audiobook save. --- diff --git a/apps/catalogue/models/listeners.py b/apps/catalogue/models/listeners.py index 7e034a1c6..e1299ab85 100644 --- a/apps/catalogue/models/listeners.py +++ b/apps/catalogue/models/listeners.py @@ -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() + permanent_cache.delete('catalogue.audiobook_list') 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', - 'catalogue.audiobook_list', 'catalogue.daisy_list']) + 'catalogue.daisy_list']) Book.published.connect(post_publish)