1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-18 16:36:15 +00:00

Merge pull request #1495 from haiwen/move-dir

fix bug when move dir
This commit is contained in:
xiez
2017-02-21 15:35:31 +08:00
committed by GitHub

View File

@@ -121,10 +121,10 @@ class CopyMoveTaskView(APIView):
username = request.user.username
if operation == 'move':
if dirent_type == 'dir' and src_repo_id == dst_repo_id and \
dst_parent_dir.startswith(src_parent_dir + '/'):
dst_parent_dir.startswith(src_dirent_path + '/'):
error_msg = _(u'Can not move directory %(src)s to its subdirectory %(des)s') \
% {'src': escape(src_parent_dir), 'des': escape( dst_parent_dir)}
% {'src': escape(src_dirent_path), 'des': escape(dst_parent_dir)}
return api_error(status.HTTP_400_BAD_REQUEST, error_msg)
# permission check for src parent dir