[manual] Remove now-unused User model.

I think all that one needs to do to deploy this commit is on developer
laptops, run `generate-fixtures --force`.

(imported from commit 34916341435fef0875b5a2c7f53c2f5606cd16cd)
This commit is contained in:
Tim Abbott
2013-04-01 10:57:50 -04:00
parent a8e89962d8
commit 1cec86eb2d
10 changed files with 37 additions and 130 deletions

View File

@@ -62,29 +62,14 @@ def user_profile_by_email_cache_key(email):
# with high likelihood be ASCII-only for the foreseeable future.
return 'user_profile_by_email:%s' % (make_safe_digest(email),)
def user_profile_by_user_cache_key(user_id):
return 'user_profile_by_user_id:%d' % (user_id,)
def user_profile_by_id_cache_key(user_profile_id):
return "user_profile_by_id:%s" % (user_profile_id,)
def user_by_id_cache_key(user_id):
return 'user_by_id:%d' % (user_id,)
# Called by models.py to flush the user_profile cache whenever we save
# a user_profile object
def update_user_profile_cache(sender, **kwargs):
user_profile = kwargs['instance']
items_for_memcached = {}
items_for_memcached[user_profile_by_email_cache_key(user_profile.email)] = (user_profile,)
items_for_memcached[user_profile_by_user_cache_key(user_profile.user.id)] = (user_profile,)
items_for_memcached[user_profile_by_id_cache_key(user_profile.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)