You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
We added the ability to create a new tree, but never gave users the tools to remove them. Now you can create any number of trees but it is impossible to delete them.
!!! For this first version, allow to delete any tree that is not the discipline default
To Reproduce
Steps to reproduce the behavior:
Go to the tree viewer
Add a new tree (e.g. Entomology)
Remove all ranks (except the root), prepare for wrist strain.
Try to delete the root node (see error due to business rules)
TreeBusinessRuleException
Can not delete root level tree definition item
Try to delete the tree from the form, see error
Expected behavior
If the user can create a tree, they should also be able to remove it. This process should not require the user to delete each rank individually or all of the nodes; the entire tree should be deletable at once.
The taxon tree should be removable if it meets the following criteria:
No determinations are linked to nodes present in that tree
The tree is not referenced in the discipline table as the default
The collection has more than 1 tree
The collection's default COT does not link to that tree
Only institution admins should have this capability, else add a permission specifically for tree creation/removal.
@CarolineDenis Is this something we need to ship alongside the ability to create trees? Seems like we may introduce some issues here if done by accident.
NOTES:
We could maybe change the on_delete=protect_with_blockers to on_delete=models.CASCADE for the references to definition in Taxon and TaxonTreeItems.
As well as for definitionitem in taxon
Also need to remove or change the tree bus rule for
@orm_signal_handler('pre_delete')
def cannot_delete_root_treedefitem(sender, obj):
Describe the bug
We added the ability to create a new tree, but never gave users the tools to remove them. Now you can create any number of trees but it is impossible to delete them.
!!! For this first version, allow to delete any tree that is not the discipline default
To Reproduce
Steps to reproduce the behavior:
Expected behavior
If the user can create a tree, they should also be able to remove it. This process should not require the user to delete each rank individually or all of the nodes; the entire tree should be deletable at once.
The taxon tree should be removable if it meets the following criteria:
discipline
table as the defaultOnly institution admins should have this capability, else add a permission specifically for tree creation/removal.
Screenshots
Screen.Recording.2024-12-10.at.9.12.51.AM.mov
Crash Report
Uploading Specify 7 Crash Report - 2024-12-10T15_13_39.141Z.txt…
macOS, Arc,
production
(6b071d7)geo-swiss.specifycloud.org
spadmin
user,Geology
disciplineThe text was updated successfully, but these errors were encountered: