X-Git-Url: https://git.mdrn.pl/wolnelektury.git/blobdiff_plain/3596cf9db6eabb5f0aa36afe7919bc40e8ff0b9a..972f33fb2d98a9ff59c931ac6a8a82def7cea6fe:/src/catalogue/signals.py diff --git a/src/catalogue/signals.py b/src/catalogue/signals.py index 81c0b9ce6..9b8fb55b2 100644 --- a/src/catalogue/signals.py +++ b/src/catalogue/signals.py @@ -67,11 +67,6 @@ def tag_after_change(sender, instance, **kwargs): for model_instance in model.tagged.with_all([instance]).only('pk'): model_instance.clear_cache() - if instance.category == 'author': - for model in Fragment, PictureArea: - for model_instance in model.tagged.with_all([instance]).only('pk'): - model_instance.clear_cache() - @receiver(tags_updated) def receive_tags_updated(sender, instance, affected_tags, **kwargs): @@ -80,4 +75,5 @@ def receive_tags_updated(sender, instance, affected_tags, **kwargs): return caches[settings.CACHE_MIDDLEWARE_ALIAS].clear() - instance.clear_cache() + if sender in (Book, Picture): + instance.clear_cache()