Skip to content
This repository has been archived by the owner on Jan 20, 2024. It is now read-only.

Commit

Permalink
Fix demoting new tasks to tree level 3 or more
Browse files Browse the repository at this point in the history
  • Loading branch information
tdemin committed Jun 13, 2019
1 parent 575b8b6 commit 5189303
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion project_amber/helpers/task.py
Expand Up @@ -68,7 +68,7 @@ def updateTask(task_id: int, uid: int, **kwargs) -> int:
# TODO: we limit changing parent IDs to prevent circular deps,
# can this be done better?
new_parent = getTask(kwargs["parent_id"], uid)
if new_parent.gen > task.gen:
if new_parent.gen > task.gen and task.is_child():
raise BadRequest(MSG_TASK_DANGEROUS)
task.parent_id = new_parent.id
updateChildren(task.id)
Expand Down

0 comments on commit 5189303

Please sign in to comment.