Fix issues with deleting roles:

1. Prevents roles from being created with the role 'None'
2. Only call EnvironmentRoles.delete() if the env_role exists
3. Update the filter on the role field of the app member form to return
'No Access'. This fixed an issue where if a role was deleted, then other
env roles belonging to the app member could not be updated because the
role field of the deleted env_role was invalid
This commit is contained in:
leigh-mil
2019-10-28 15:59:23 -04:00
parent f928b776a6
commit d33fcb6073
2 changed files with 5 additions and 5 deletions

View File

@@ -16,7 +16,7 @@ class EnvironmentForm(Form):
environment_name,
choices=ENV_ROLES,
default=NO_ACCESS,
filters=[lambda x: None if x == "None" else x],
filters=[lambda x: NO_ACCESS if x == "None" else x],
)
deleted = BooleanField("Revoke Access", default=False)