Show proper display_status
This commit is contained in:
parent
ae70a551a9
commit
fa8c59b944
@ -20,6 +20,7 @@ MEMBER_STATUSES = {
|
|||||||
"error": "Error on invite",
|
"error": "Error on invite",
|
||||||
"pending": "Pending",
|
"pending": "Pending",
|
||||||
"unknown": "Unknown errors",
|
"unknown": "Unknown errors",
|
||||||
|
"disabled": "Disabled"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -83,6 +84,8 @@ class WorkspaceRole(Base, mixins.TimestampsMixin, mixins.AuditableMixin):
|
|||||||
def display_status(self):
|
def display_status(self):
|
||||||
if self.status == Status.ACTIVE:
|
if self.status == Status.ACTIVE:
|
||||||
return MEMBER_STATUSES["active"]
|
return MEMBER_STATUSES["active"]
|
||||||
|
elif self.status == Status.DISABLED:
|
||||||
|
return MEMBER_STATUSES["disabled"]
|
||||||
elif self.latest_invitation:
|
elif self.latest_invitation:
|
||||||
if self.latest_invitation.is_revoked:
|
if self.latest_invitation.is_revoked:
|
||||||
return MEMBER_STATUSES["revoked"]
|
return MEMBER_STATUSES["revoked"]
|
||||||
|
Loading…
x
Reference in New Issue
Block a user