policies: fix application cached not being cleared correctly

This commit is contained in:
Jens Langhammer 2021-01-30 18:12:01 +01:00
parent 5af9e8c05d
commit 7fbf915e0a
2 changed files with 2 additions and 2 deletions

View File

@ -28,7 +28,7 @@ class PolicyCacheClearView(AdminRequiredMixin, SuccessMessageMixin, FormView):
cache.delete_many(keys) cache.delete_many(keys)
LOGGER.debug("Cleared Policy cache", keys=len(keys)) LOGGER.debug("Cleared Policy cache", keys=len(keys))
# Also delete user application cache # Also delete user application cache
keys = user_app_cache_key("*") keys = cache.keys(user_app_cache_key("*"))
cache.delete_many(keys) cache.delete_many(keys)
return super().post(request, *args, **kwargs) return super().post(request, *args, **kwargs)

View File

@ -26,5 +26,5 @@ def invalidate_policy_cache(sender, instance, **_):
cache.delete_many(keys) cache.delete_many(keys)
LOGGER.debug("Invalidating policy cache", policy=instance, keys=total) LOGGER.debug("Invalidating policy cache", policy=instance, keys=total)
# Also delete user application cache # Also delete user application cache
keys = user_app_cache_key("*") keys = cache.keys(user_app_cache_key("*"))
cache.delete_many(keys) cache.delete_many(keys)