Add is_revokable property to Invitation
This commit is contained in:
parent
923313dafa
commit
35b3565c0f
@ -87,3 +87,7 @@ class Invitation(Base, TimestampsMixin, AuditableMixin):
|
|||||||
@property
|
@property
|
||||||
def user_name(self):
|
def user_name(self):
|
||||||
return self.workspace_role.user.full_name
|
return self.workspace_role.user.full_name
|
||||||
|
|
||||||
|
@property
|
||||||
|
def is_revokable(self):
|
||||||
|
return self.is_pending and not self.is_expired
|
||||||
|
@ -40,7 +40,7 @@
|
|||||||
<a href='{{ url_for("users.user") }}' class='icon-link'>edit account details</a>
|
<a href='{{ url_for("users.user") }}' class='icon-link'>edit account details</a>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
<div>
|
<div>
|
||||||
{% if member.latest_invitation.is_pending %}
|
{% if member.latest_invitation.is_revokable %}
|
||||||
{{ ConfirmationButton(
|
{{ ConfirmationButton(
|
||||||
"Revoke Invitation",
|
"Revoke Invitation",
|
||||||
url_for("workspaces.revoke_invitation", workspace_id=workspace.id, token=member.latest_invitation.token),
|
url_for("workspaces.revoke_invitation", workspace_id=workspace.id, token=member.latest_invitation.token),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user