Skip to content

Commit

Permalink
Prevent reparenting a tag to itself
Browse files Browse the repository at this point in the history
Sidebar.check_parent now checks if the drop target is the same
tag we are moving.
  • Loading branch information
gycsaba96 authored and diegogangl committed Nov 4, 2024
1 parent 0925ba9 commit 70149ce
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion GTG/gtk/browser/sidebar.py
Original file line number Diff line number Diff line change
Expand Up @@ -591,7 +591,10 @@ def drag_end(self, source, drag, unused):


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

if value == target:
return False

item = target
while item.parent:
Expand Down

0 comments on commit 70149ce

Please sign in to comment.