mirror of
https://github.com/haiwen/seahub.git
synced 2025-09-01 07:01:12 +00:00
update base/context_processors.py for av atar url
This commit is contained in:
@@ -75,6 +75,8 @@ def base(request):
|
|||||||
favicon_path = FAVICON_PATH
|
favicon_path = FAVICON_PATH
|
||||||
|
|
||||||
# filter ajax/api request out
|
# filter ajax/api request out
|
||||||
|
avatar_url = ''
|
||||||
|
username = request.user.username
|
||||||
if (not request.is_ajax()) and ("api2/" not in request.path) and \
|
if (not request.is_ajax()) and ("api2/" not in request.path) and \
|
||||||
("api/v2.1/" not in request.path):
|
("api/v2.1/" not in request.path):
|
||||||
|
|
||||||
@@ -87,8 +89,6 @@ def base(request):
|
|||||||
custom_favicon_file = os.path.join(MEDIA_ROOT, CUSTOM_FAVICON_PATH)
|
custom_favicon_file = os.path.join(MEDIA_ROOT, CUSTOM_FAVICON_PATH)
|
||||||
if os.path.exists(custom_favicon_file):
|
if os.path.exists(custom_favicon_file):
|
||||||
favicon_path = CUSTOM_FAVICON_PATH
|
favicon_path = CUSTOM_FAVICON_PATH
|
||||||
|
|
||||||
username = request.user.username
|
|
||||||
avatar_url, is_default, date_uploaded = api_avatar_url(username, 72)
|
avatar_url, is_default, date_uploaded = api_avatar_url(username, 72)
|
||||||
|
|
||||||
result = {
|
result = {
|
||||||
@@ -134,7 +134,7 @@ def base(request):
|
|||||||
'service_url': get_service_url().rstrip('/'),
|
'service_url': get_service_url().rstrip('/'),
|
||||||
'enable_file_scan': ENABLE_FILE_SCAN,
|
'enable_file_scan': ENABLE_FILE_SCAN,
|
||||||
'enable_work_weixin_departments': ENABLE_WORK_WEIXIN_DEPARTMENTS,
|
'enable_work_weixin_departments': ENABLE_WORK_WEIXIN_DEPARTMENTS,
|
||||||
'avatar_url': request.build_absolute_uri(avatar_url),
|
'avatar_url': request.build_absolute_uri(avatar_url) if avatar_url else '',
|
||||||
}
|
}
|
||||||
|
|
||||||
if request.user.is_staff:
|
if request.user.is_staff:
|
||||||
|
Reference in New Issue
Block a user