mirror of
https://github.com/haiwen/seahub.git
synced 2025-09-27 15:54:39 +00:00
rm get_share_in_repo_list
func from ajax.py
This commit is contained in:
@@ -76,8 +76,7 @@ from seahub.utils.timeutils import utc_to_local, datetime_to_isoformat_timestr
|
|||||||
from seahub.views import is_registered_user, check_file_lock, \
|
from seahub.views import is_registered_user, check_file_lock, \
|
||||||
group_events_data, get_diff, create_default_library, \
|
group_events_data, get_diff, create_default_library, \
|
||||||
list_inner_pub_repos, check_folder_permission
|
list_inner_pub_repos, check_folder_permission
|
||||||
from seahub.views.ajax import get_share_in_repo_list, get_groups_by_user, \
|
from seahub.views.ajax import get_groups_by_user, get_group_repos
|
||||||
get_group_repos
|
|
||||||
from seahub.views.file import get_file_view_path_and_perm, send_file_access_msg
|
from seahub.views.file import get_file_view_path_and_perm, send_file_access_msg
|
||||||
if HAS_FILE_SEARCH:
|
if HAS_FILE_SEARCH:
|
||||||
from seahub_extra.search.views import search_keyword
|
from seahub_extra.search.views import search_keyword
|
||||||
@@ -459,7 +458,15 @@ class Repos(APIView):
|
|||||||
repos_json.append(repo)
|
repos_json.append(repo)
|
||||||
|
|
||||||
if filter_by['shared']:
|
if filter_by['shared']:
|
||||||
shared_repos = get_share_in_repo_list(request, -1, -1)
|
|
||||||
|
if is_org_context(request):
|
||||||
|
org_id = request.user.org.org_id
|
||||||
|
shared_repos = seafile_api.get_org_share_in_repo_list(org_id,
|
||||||
|
email, -1, -1)
|
||||||
|
else:
|
||||||
|
shared_repos = seafile_api.get_share_in_repo_list(
|
||||||
|
email, -1, -1)
|
||||||
|
|
||||||
shared_repos.sort(lambda x, y: cmp(y.last_modify, x.last_modify))
|
shared_repos.sort(lambda x, y: cmp(y.last_modify, x.last_modify))
|
||||||
for r in shared_repos:
|
for r in shared_repos:
|
||||||
r.password_need = is_passwd_set(r.repo_id, email)
|
r.password_need = is_passwd_set(r.repo_id, email)
|
||||||
@@ -475,7 +482,7 @@ class Repos(APIView):
|
|||||||
"size": r.size,
|
"size": r.size,
|
||||||
"size_formatted": filesizeformat(r.size),
|
"size_formatted": filesizeformat(r.size),
|
||||||
"encrypted": r.encrypted,
|
"encrypted": r.encrypted,
|
||||||
"permission": r.user_perm,
|
"permission": r.permission,
|
||||||
"share_type": r.share_type,
|
"share_type": r.share_type,
|
||||||
"root": r.root,
|
"root": r.root,
|
||||||
"head_commit_id": r.head_cmmt_id,
|
"head_commit_id": r.head_cmmt_id,
|
||||||
|
@@ -1433,21 +1433,6 @@ def space_and_traffic(request):
|
|||||||
context_instance=RequestContext(request))
|
context_instance=RequestContext(request))
|
||||||
return HttpResponse(json.dumps({"html": html}), content_type=content_type)
|
return HttpResponse(json.dumps({"html": html}), content_type=content_type)
|
||||||
|
|
||||||
def get_share_in_repo_list(request, start, limit):
|
|
||||||
"""List share in repos.
|
|
||||||
"""
|
|
||||||
username = request.user.username
|
|
||||||
if is_org_context(request):
|
|
||||||
org_id = request.user.org.org_id
|
|
||||||
repo_list = seafile_api.get_org_share_in_repo_list(org_id, username,
|
|
||||||
-1, -1)
|
|
||||||
else:
|
|
||||||
repo_list = seafile_api.get_share_in_repo_list(username, -1, -1)
|
|
||||||
|
|
||||||
for repo in repo_list:
|
|
||||||
repo.user_perm = check_folder_permission(request, repo.repo_id, '/')
|
|
||||||
return repo_list
|
|
||||||
|
|
||||||
def get_groups_by_user(request):
|
def get_groups_by_user(request):
|
||||||
"""List user groups.
|
"""List user groups.
|
||||||
"""
|
"""
|
||||||
|
Reference in New Issue
Block a user