Prevent error from being raised when user is not trying to update a
disabled env role We were only checking to see if a role was disabled or deleted before raising an error, so I added in a check to see if the user was trying to update the env role before raising an error. The error should only be raised if the role is disabled or deleted AND the user is trying to assign a new role to the env role. I also added in a disabled property to the EnvironmentRole model to make things more readable.
This commit is contained in:
@@ -66,6 +66,10 @@ class EnvironmentRole(
|
||||
def displayname(self):
|
||||
return self.role
|
||||
|
||||
@property
|
||||
def disabled(self):
|
||||
return self.status == EnvironmentRole.Status.DISABLED
|
||||
|
||||
@property
|
||||
def event_details(self):
|
||||
return {
|
||||
|
||||
Reference in New Issue
Block a user