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.
This commit is contained in:
barredterra 2023-07-25 17:01:57 +02:00
parent 2c1943c7e6
commit fd2c272bed

View File

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