1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-19 10:26:17 +00:00

show repo name when upload file to root directory

This commit is contained in:
lian
2015-10-20 11:51:23 +08:00
parent 9d0b849b68
commit 9f4dea6475

View File

@@ -532,8 +532,16 @@ def view_shared_upload_link(request, token):
username = uploadlink.username
repo_id = uploadlink.repo_id
repo = get_repo(repo_id)
if not repo:
raise Http404
path = uploadlink.path
dir_name = os.path.basename(path[:-1])
if path == '/':
# use repo name as dir name if share whole library
dir_name = repo.name
else:
dir_name = os.path.basename(path[:-1])
repo = get_repo(repo_id)
if not repo: