Change order of if/elif statement for ApplicationRole display_status
Since an invite that is expired has a status of 'pending', the ordering of the if/elif statement needs to be switched so it checks to see if the invite is expired before seeing if it is pending.
This commit is contained in:
@@ -113,19 +113,17 @@ class ApplicationRole(
|
|||||||
@property
|
@property
|
||||||
def display_status(self):
|
def display_status(self):
|
||||||
if (
|
if (
|
||||||
self.is_pending
|
|
||||||
and self.latest_invitation
|
|
||||||
and self.latest_invitation.is_pending
|
|
||||||
):
|
|
||||||
return "invite_pending"
|
|
||||||
|
|
||||||
elif (
|
|
||||||
self.is_pending
|
self.is_pending
|
||||||
and self.latest_invitation
|
and self.latest_invitation
|
||||||
and self.latest_invitation.is_expired
|
and self.latest_invitation.is_expired
|
||||||
):
|
):
|
||||||
return "invite_expired"
|
return "invite_expired"
|
||||||
|
elif (
|
||||||
|
self.is_pending
|
||||||
|
and self.latest_invitation
|
||||||
|
and self.latest_invitation.is_pending
|
||||||
|
):
|
||||||
|
return "invite_pending"
|
||||||
elif self.is_active and any(
|
elif self.is_active and any(
|
||||||
env_role.is_pending for env_role in self.environment_roles
|
env_role.is_pending for env_role in self.environment_roles
|
||||||
):
|
):
|
||||||
|
Reference in New Issue
Block a user