1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-06-30 00:42:53 +00:00
seahub/organizations/utils.py

20 lines
392 B
Python
Raw Normal View History

2012-07-26 09:08:31 +00:00
import sys
from django.core.cache import cache
from settings import ORG_CACHE_PREFIX
def clear_org_ctx(request):
"""
"""
cache.delete(ORG_CACHE_PREFIX + request.user.username)
request.user.org = None
def set_org_ctx(request, org_dict):
"""
"""
cache.set(ORG_CACHE_PREFIX + request.user.username, org_dict, sys.maxint)
request.user.org = org_dict