mirror of
https://github.com/haiwen/seahub.git
synced 2025-09-25 23:02:26 +00:00
Merge pull request #153 from urg/FixRename
not sure why variable names were lost - perhaps this isn't the correct t...
This commit is contained in:
@@ -1171,12 +1171,14 @@ class FileView(APIView):
|
|||||||
return api_error(status.HTTP_400_BAD_REQUEST, 'Newname too long')
|
return api_error(status.HTTP_400_BAD_REQUEST, 'Newname too long')
|
||||||
|
|
||||||
parent_dir = os.path.dirname(path)
|
parent_dir = os.path.dirname(path)
|
||||||
|
parent_dir_utf8 = parent_dir.encode('utf-8')
|
||||||
oldname = os.path.basename(path)
|
oldname = os.path.basename(path)
|
||||||
if oldname == newname:
|
if oldname == newname:
|
||||||
return api_error(status.HTTP_409_CONFLICT,
|
return api_error(status.HTTP_409_CONFLICT,
|
||||||
'The new name is the same to the old')
|
'The new name is the same to the old')
|
||||||
|
|
||||||
newname = check_filename_with_rename(repo_id, parent_dir, newname)
|
newname = check_filename_with_rename(repo_id, parent_dir, newname)
|
||||||
|
newname_utf8 = newname.encode('utf-8')
|
||||||
try:
|
try:
|
||||||
seafile_api.rename_file (repo_id, parent_dir,
|
seafile_api.rename_file (repo_id, parent_dir,
|
||||||
oldname, newname,
|
oldname, newname,
|
||||||
|
Reference in New Issue
Block a user