From 616b80d1889b6e442eea47d715388e3a41a8f07f Mon Sep 17 00:00:00 2001 From: lian Date: Mon, 20 Feb 2017 17:55:34 +0800 Subject: [PATCH] fix bug when move dir --- seahub/api2/endpoints/copy_move_task.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/seahub/api2/endpoints/copy_move_task.py b/seahub/api2/endpoints/copy_move_task.py index ae417b1145..e5e55dcfe0 100644 --- a/seahub/api2/endpoints/copy_move_task.py +++ b/seahub/api2/endpoints/copy_move_task.py @@ -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