mirror of
https://github.com/zulip/zulip.git
synced 2025-11-07 07:23:22 +00:00
Flush the User cache when saving User objects too.
(imported from commit e595209fe1190e2f3e0d55ad3b9bae0997b91d1a)
This commit is contained in:
@@ -72,3 +72,12 @@ def update_user_profile_cache(sender, **kwargs):
|
||||
items_for_memcached[userprofile_by_email_cache_key(user_profile.user.email)] = (user_profile,)
|
||||
items_for_memcached[userprofile_by_user_cache_key(user_profile.user.id)] = (user_profile,)
|
||||
djcache.set_many(items_for_memcached)
|
||||
|
||||
# Called by models.py to flush the user_profile cache whenever we save
|
||||
# a user_profile object
|
||||
def update_user_cache(sender, **kwargs):
|
||||
user = kwargs['instance']
|
||||
items_for_memcached = {}
|
||||
items_for_memcached[user_by_id_cache_key(user.id)] = (user,)
|
||||
djcache.set_many(items_for_memcached)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user