Determine member status based on invitations
This commit is contained in:
parent
401a9e93a7
commit
f8e16a96d2
@ -36,6 +36,18 @@ class WorkspaceRole(Base, mixins.TimestampsMixin, mixins.AuditableMixin):
|
|||||||
self.role.name, self.workspace.name, self.user_id, self.id
|
self.role.name, self.workspace.name, self.user_id, self.id
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@property
|
||||||
|
def display_status(self):
|
||||||
|
if self.status == Status.ACTIVE:
|
||||||
|
return "Active"
|
||||||
|
else:
|
||||||
|
if any(i.is_expired for i in self.invitations):
|
||||||
|
return "Invitation Expired"
|
||||||
|
elif any(i.is_rejected for i in self.invitations):
|
||||||
|
return "Invitation Rejected"
|
||||||
|
else:
|
||||||
|
return "Pending"
|
||||||
|
|
||||||
|
|
||||||
Index(
|
Index(
|
||||||
"workspace_role_user_workspace",
|
"workspace_role_user_workspace",
|
||||||
|
@ -35,7 +35,7 @@ class WorkspaceUser(object):
|
|||||||
|
|
||||||
@property
|
@property
|
||||||
def status(self):
|
def status(self):
|
||||||
return "active"
|
return self.workspace_role.display_status
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def num_environment_roles(self):
|
def num_environment_roles(self):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user