75451: Show custom error message when removing last user from workflow group

This commit is contained in:
Bruno Roemers
2021-01-05 14:48:36 +01:00
parent 250c87dc16
commit c878293b99
5 changed files with 67 additions and 4 deletions

View File

@@ -283,9 +283,7 @@ public class EPersonServiceImpl extends DSpaceObjectServiceImpl<EPerson> impleme
for (Group group: workFlowGroups) {
List<EPerson> ePeople = groupService.allMembers(context, group);
if (ePeople.size() == 1 && ePeople.contains(ePerson)) {
throw new IllegalStateException(
"Refused to delete user " + ePerson.getID() + " because it the only member of the workflow group"
+ group.getID() + ". Delete the tasks and group first if you want to remove this user.");
throw new EmptyWorkflowGroupException(ePerson.getID(), group.getID());
}
}
// check for presence of eperson in tables that