Merge pull request #499 from dod-ccpo/workspace-member-buttons-#162641480
Workspace member buttons #162641480
This commit is contained in:
@@ -77,7 +77,18 @@ class Invitation(Base, TimestampsMixin, AuditableMixin):
|
||||
|
||||
@property
|
||||
def is_expired(self):
|
||||
return datetime.datetime.now(self.expiration_time.tzinfo) > self.expiration_time
|
||||
return (
|
||||
datetime.datetime.now(self.expiration_time.tzinfo) > self.expiration_time
|
||||
and not self.status == Status.ACCEPTED
|
||||
)
|
||||
|
||||
@property
|
||||
def is_inactive(self):
|
||||
return self.is_expired or self.status in [
|
||||
Status.REJECTED_WRONG_USER,
|
||||
Status.REJECTED_EXPIRED,
|
||||
Status.REVOKED,
|
||||
]
|
||||
|
||||
@property
|
||||
def workspace(self):
|
||||
|
@@ -117,6 +117,10 @@ class WorkspaceRole(Base, mixins.TimestampsMixin, mixins.AuditableMixin):
|
||||
def role_displayname(self):
|
||||
return self.role.display_name
|
||||
|
||||
@property
|
||||
def is_active(self):
|
||||
return self.status == Status.ACTIVE
|
||||
|
||||
@property
|
||||
def num_environment_roles(self):
|
||||
return (
|
||||
@@ -147,8 +151,8 @@ class WorkspaceRole(Base, mixins.TimestampsMixin, mixins.AuditableMixin):
|
||||
|
||||
@property
|
||||
def can_resend_invitation(self):
|
||||
return self.latest_invitation and (
|
||||
self.latest_invitation.is_rejected or self.latest_invitation.is_expired
|
||||
return not self.is_active and (
|
||||
self.latest_invitation and self.latest_invitation.is_inactive
|
||||
)
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user