1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-08-31 14:42:10 +00:00

return salt info when get repo list (#4134)

This commit is contained in:
lian
2019-10-10 15:11:24 +08:00
committed by Daniel Pan
parent ea61e5e4c5
commit 6c49efe500
2 changed files with 8 additions and 0 deletions

View File

@@ -120,6 +120,7 @@ class ReposView(APIView):
"permission": 'rw', # Always have read-write permission to owned repo
"starred": r.repo_id in starred_repo_id_list,
"status": normalize_repo_status_code(r.status),
"salt": r.salt if r.enc_version == 3 else '',
}
if is_pro_version() and ENABLE_STORAGE_CLASSES:
@@ -182,6 +183,7 @@ class ReposView(APIView):
"permission": r.permission,
"starred": r.repo_id in starred_repo_id_list,
"status": normalize_repo_status_code(r.status),
"salt": r.salt if r.enc_version == 3 else '',
}
if r.repo_id in repos_with_admin_share_to:
@@ -225,6 +227,7 @@ class ReposView(APIView):
"permission": r.permission,
"starred": r.repo_id in starred_repo_id_list,
"status": normalize_repo_status_code(r.status),
"salt": r.salt if r.enc_version == 3 else '',
}
repo_info_list.append(repo_info)
@@ -269,6 +272,7 @@ class ReposView(APIView):
"permission": r.permission,
"starred": r.repo_id in starred_repo_id_list,
"status": normalize_repo_status_code(r.status),
"salt": r.salt if r.enc_version == 3 else '',
}
repo_info_list.append(repo_info)

View File

@@ -734,6 +734,7 @@ class Repos(APIView):
"root": '',
"head_commit_id": r.head_cmmt_id,
"version": r.version,
"salt": r.salt if r.enc_version == 3 else '',
}
if is_pro_version() and ENABLE_STORAGE_CLASSES:
@@ -802,6 +803,7 @@ class Repos(APIView):
"head_commit_id": r.head_cmmt_id,
"version": r.version,
"group_name": library_group_name,
"salt": r.salt if r.enc_version == 3 else '',
}
if r.repo_id in repos_with_admin_share_to:
@@ -859,6 +861,7 @@ class Repos(APIView):
"share_from": r.user,
"share_from_name": nickname_dict.get(r.user, ''),
"share_from_contact_email": contact_email_dict.get(r.user, ''),
"salt": r.salt if r.enc_version == 3 else '',
}
repos_json.append(repo)
@@ -899,6 +902,7 @@ class Repos(APIView):
"root": '',
"head_commit_id": r.head_cmmt_id,
"version": r.version,
"salt": r.salt if r.enc_version == 3 else '',
}
repos_json.append(repo)