pre_delete.connect(_pre_delete_handler)
+def _post_delete_handler(sender, instance, **kwargs):
+ """ refresh Book on BookMedia delete """
+ if sender == Collection:
+ permanent_cache.delete('catalogue.collection:%s' % instance.slug)
+ permanent_cache.delete('catalogue.catalogue')
+post_delete.connect(_post_delete_handler)
+
+
def _post_save_handler(sender, instance, **kwargs):
""" refresh all the short_html stuff on BookMedia update """
if sender == BookMedia:
'catalogue.audiobook_list', 'catalogue.daisy_list'])
elif sender == Collection:
permanent_cache.delete('catalogue.collection:%s' % instance.slug)
+ permanent_cache.delete('catalogue.catalogue')
post_save.connect(_post_save_handler)