diff --git a/base/context_processors.py b/base/context_processors.py index 08e2f2c8a6..1cb9bde363 100644 --- a/base/context_processors.py +++ b/base/context_processors.py @@ -6,7 +6,8 @@ and returns a dictionary to add to the context. These are referenced from the setting TEMPLATE_CONTEXT_PROCESSORS and used by RequestContext. """ -import settings +from settings import SEAFILE_VERSION +from settings import SEAHUB_TITLE def base(request): """ @@ -14,8 +15,9 @@ def base(request): """ return { - 'seafile_version': settings.SEAFILE_VERSION, - 'seahub_title': settings.SEAHUB_TITLE, + 'seafile_version': SEAFILE_VERSION, + 'seahub_title': SEAHUB_TITLE, + 'official_mode': request.official_mode, # 'account_type': settings.ACCOUNT_TYPE, } diff --git a/organizations/middleware.py b/organizations/middleware.py index 3e74c1e7ff..197b2a0792 100644 --- a/organizations/middleware.py +++ b/organizations/middleware.py @@ -5,9 +5,9 @@ from seaserv import get_org_by_url_prefix, get_orgs_by_user from settings import ORG_CACHE_PREFIX try: - from seahub.settings import USE_ORG + from seahub.settings import OFFICIAL_MODE except ImportError: - USE_ORG = False + OFFICIAL_MODE = False class OrganizationMiddleware(object): """ @@ -16,8 +16,8 @@ class OrganizationMiddleware(object): """ def process_request(self, request): - if USE_ORG: - request.use_org = True + if OFFICIAL_MODE: + request.official_mode = True # Get current org context org = cache.get(ORG_CACHE_PREFIX + request.user.username) @@ -27,7 +27,7 @@ class OrganizationMiddleware(object): orgs = get_orgs_by_user(request.user.username) request.user.orgs = orgs else: - request.use_org = False + request.official_mode = False request.user.org = None request.user.orgs = None diff --git a/settings.py b/settings.py index 1f34ee7f99..8462dd1a4e 100644 --- a/settings.py +++ b/settings.py @@ -233,4 +233,4 @@ LOGIN_URL = SITE_ROOT + 'accounts/login' USER_TOTAL_SPACE = 2 * pow(2,30) -SEAFILE_VERSION = '0.9.4' +SEAFILE_VERSION = '0.9.5' diff --git a/templates/admin_base.html b/templates/admin_base.html index 301373701a..b1110d74ce 100644 --- a/templates/admin_base.html +++ b/templates/admin_base.html @@ -12,7 +12,7 @@