Prevent group/region deletion if there are still entities attached below
As an orga member it is possible to delete a region (or a workgroup) with stores, food share points and (sub-)workgorups below. This shouldn not be possible and at least throw an error. This is harming data consistency.
Entities (I'm sure with some. Others are to be checked):
- stores
- food share points
- regions / workgroups
- foodsavers (?)
- threads (handling?)
Also think about if there are other entitites bound to the region_id
.
Find deleteGroupAction()
and think about adding conditions checking for mentioned entities. What could be a good http status code for this?
Unfortunately the region_id
of mentioned entities aren't set to NULL
. This makes it look like as if they are still bound to a region which they are not. This makes it hard to find those.
Folling up a cleanup issue/task is needed to find these lost entities.
Maybe @saj2007 can be asked if there are additional problems specificly with deletion with this. IT wasn't aware of this problem so far.