idlesign/django-sitetree

It should not be possible to add a TreeItem with a parent in a different Tree

flupzor opened this issue · 4 comments

When you add a TreeItem in the django admin (sitetree/tree/1/change/item_add/), you can select a parent. This list is not filtered on items within the current tree. This makes it possible to select a TreeItem which is in a different Tree then the TreeItem you're adding.

Adding such an item will result in the tree rendering code to throw an error, and the page you're trying to render the sitetree on not working anymore.

It should be easy to replicate this issue by creating two Trees which each have a TreeItem, and creating a sub TreeItem in the first Tree, which has a parent TreeItem which exists in the second Tree.

Thank you.
I'll try to look into it this week.

Yes, I confirm the regression. Will fix.

Seems to be fixed. 1.13.2 released.
Closing this. Thank you.

Awesome! Thanks for the quick fix.