Check to see if the env_role has been provisioned before disabling env_role in the csp
This commit is contained in:
@@ -105,7 +105,7 @@ class EnvironmentRoles(object):
|
||||
def disable(cls, environment_role_id):
|
||||
environment_role = EnvironmentRoles.get_by_id(environment_role_id)
|
||||
|
||||
if not environment_role.environment.is_pending:
|
||||
if environment_role.csp_user_id and not environment_role.environment.is_pending:
|
||||
credentials = environment_role.environment.csp_credentials
|
||||
app.csp.cloud.disable_user(credentials, environment_role.csp_user_id)
|
||||
|
||||
|
Reference in New Issue
Block a user