-# This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later.
-# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information.
+# This file is part of Wolne Lektury, licensed under GNU Affero GPLv3 or later.
+# Copyright © Fundacja Wolne Lektury. See NOTICE for more information.
#
from django.conf import settings
from django.core.cache import caches
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):
return
caches[settings.CACHE_MIDDLEWARE_ALIAS].clear()
- instance.clear_cache()
+ if sender in (Book, Picture):
+ instance.clear_cache()