[KEYCLOAK-1932] Unable to create flow named exactly the same as removed NON-top level flow

This commit is contained in:
girirajsharma committed 2015-10-11 12:42:07 +05:30
1 parent 960cd8c822
commit 115663a32d
1 file changed
+8
@@ -323,6 +323,14 @@ public class AuthenticationManagementResource {
if (flow.isBuiltIn()) {
throw new BadRequestException("Can't delete built in flow");
}
List<AuthenticationExecutionModel> executions = realm.getAuthenticationExecutions(id);
for (AuthenticationExecutionModel execution : executions) {
if(execution.getFlowId() != null) {
AuthenticationFlowModel nonTopLevelFlow = realm.getAuthenticationFlowById(execution.getFlowId());
realm.removeAuthenticationFlow(nonTopLevelFlow);
}
realm.removeAuthenticatorExecution(execution);
}
realm.removeAuthenticationFlow(flow);
}