mirror of
https://github.com/haiwen/seahub.git
synced 2025-09-15 23:00:57 +00:00
Modify org
This commit is contained in:
16
organizations/context_processors.py
Normal file
16
organizations/context_processors.py
Normal file
@@ -0,0 +1,16 @@
|
||||
def org(request):
|
||||
"""
|
||||
Add org info and base template that html page will extends to context.
|
||||
"""
|
||||
if hasattr(request.user, 'org') and request.user.org is not None:
|
||||
if request.user.org['is_staff']:
|
||||
base_template = 'org_admin_base.html'
|
||||
else:
|
||||
base_template = 'org_base.html'
|
||||
return {'cur_ctx': 'org',
|
||||
'org': request.user.org,
|
||||
'base_template': base_template}
|
||||
else:
|
||||
return {'cur_ctx': '',
|
||||
'base_template': 'myhome_base.html'}
|
||||
|
Reference in New Issue
Block a user