fix(Item Group): allow root deletion

It was not possible to delete an empty, unused Item Group without any
children, if it was one of possibly multiple roots of the Item Group tree.
This fix allows deleting a root Item Group.

(cherry picked from commit fd2c272bed)
This commit is contained in:
barredterra
2023-07-25 17:01:57 +02:00
committed by Mergify
parent dc603c3df0
commit 1a6be5e19b

View File

@@ -73,7 +73,7 @@ class ItemGroup(NestedSet, WebsiteGenerator):
return self.route
def on_trash(self):
NestedSet.on_trash(self)
NestedSet.on_trash(self, allow_root_deletion=True)
WebsiteGenerator.on_trash(self)
self.delete_child_item_groups_key()