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