def invalidate_accessible_projects_cache(**kwargs):
instance = kwargs["instance"]
# XXX: maybe use custom signals or simple function calls?
if (instance.__class__.__name__ not in
['Project', 'TranslationProject', 'PermissionSet']):
return
cache.delete_pattern(make_method_key('Project', 'cached_dict', '*'))
cache.delete('projects:all')
cache.delete_pattern('projects:accessible:*')
评论列表
文章目录