Skip to content

Commit

Permalink
Prevent reparenting a task to itself
Browse files Browse the repository at this point in the history
TaskPane.check_parent now checks if the drop target is the same
task we are moving.
  • Loading branch information
gycsaba96 authored and diegogangl committed Oct 18, 2024
1 parent d883f75 commit fe71813
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion GTG/gtk/browser/task_pane.py
Original file line number Diff line number Diff line change
Expand Up @@ -613,7 +613,10 @@ def drop_enter(self, target, x, y, user_data=None):


def check_parent(self, value, target) -> bool:
"""Check to parenting a parent to its own children"""
"""Check for parenting a task to its own descendant or to itself."""

if value == target:
return False

item = target
while item.parent:
Expand Down

0 comments on commit fe71813

Please sign in to comment.