Invites are revokable if they are not expired, and add success flash message

This commit is contained in:
leigh-mil 2019-09-20 11:26:28 -04:00
parent fd691bc0c1
commit a03ff56017
2 changed files with 11 additions and 1 deletions

View File

@ -391,8 +391,13 @@ def revoke_invite(application_id, application_role_id):
app_role = ApplicationRoles.get_by_id(application_role_id)
invite = app_role.latest_invitation
if invite.is_revokable:
if invite.is_pending:
ApplicationInvitations.revoke(invite.token)
flash(
"application_invite_revoked",
user_name=app_role.user_name,
application_name=g.application.name,
)
return redirect(
url_for(

View File

@ -27,6 +27,11 @@ MESSAGES = {
"message_template": "Application environments have been updated",
"category": "success",
},
"application_invite_revoked": {
"title_template": "Application invitation revoked",
"message_template": "You have successfully revoked the invite for {{ user_name }} from {{ application_name }}",
"category": "success",
},
"application_member_removed": {
"title_template": "Team member removed from application",
"message_template": "You have successfully deleted {{ user_name }} from {{ application_name }}",