Skip to content

Commit 5237f8b

Browse files
committed
fix: enhance folder movement validation to prevent exceeding depth limit
1 parent 004f78c commit 5237f8b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

apps/folders/serializers/folder.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ def edit(self, instance):
157157

158158
# 模块间的移动
159159
parent_id = instance.get('parent_id')
160-
if parent_id is not None and current_id != current_node.workspace_id:
160+
if parent_id is not None and current_id != current_node.workspace_id and current_node.parent_id != parent_id:
161161
# Folder 不能超过3层
162162
current_depth = get_max_depth(current_node)
163163
check_depth(self.data.get('source'), parent_id, current_node.workspace_id, current_depth)

0 commit comments

Comments
 (0)