Closed kflemin closed 8 months ago
I think https://github.com/SEED-platform/seed/pull/4492 fixes it?
Instance: dev2 SHA: a79e79785 Org: LBNL 406
Clicked on the Delete icon for Level 3, AH County / Alameda and this message appeared, which is correct. \
I then clicked the Delete button, and that level, with all it's properties, was deleted, which is also correct.
Properties and property states are created during the import process and are not necessarily cleaned up by deleting a property from the inventory list page. There could be lingering properties or property states that are associated with a particular ALI, but that are not associated with a property view, and are therefore invisible to the user.
Use cases that can cause this issue are: 1) bailing halfway through the import process and 2) the match-merge-link process.
When this happens, even though there are no properties visible to the user that are associated with an ALI, the ALI cannot be deleted. The same situation occurs when there are users attached to the ALI.
Example error that gets returned to the user: Cannot delete this access level instance. - Has 10 related Property States
Otherwise, the only recovery from this is for an admin to "Remove Inventory" on the whole org.