Invites are revokable if they are not expired, and add success flash message
This commit is contained in:
parent
fd691bc0c1
commit
a03ff56017
@ -391,8 +391,13 @@ def revoke_invite(application_id, application_role_id):
|
|||||||
app_role = ApplicationRoles.get_by_id(application_role_id)
|
app_role = ApplicationRoles.get_by_id(application_role_id)
|
||||||
invite = app_role.latest_invitation
|
invite = app_role.latest_invitation
|
||||||
|
|
||||||
if invite.is_revokable:
|
if invite.is_pending:
|
||||||
ApplicationInvitations.revoke(invite.token)
|
ApplicationInvitations.revoke(invite.token)
|
||||||
|
flash(
|
||||||
|
"application_invite_revoked",
|
||||||
|
user_name=app_role.user_name,
|
||||||
|
application_name=g.application.name,
|
||||||
|
)
|
||||||
|
|
||||||
return redirect(
|
return redirect(
|
||||||
url_for(
|
url_for(
|
||||||
|
@ -27,6 +27,11 @@ MESSAGES = {
|
|||||||
"message_template": "Application environments have been updated",
|
"message_template": "Application environments have been updated",
|
||||||
"category": "success",
|
"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": {
|
"application_member_removed": {
|
||||||
"title_template": "Team member removed from application",
|
"title_template": "Team member removed from application",
|
||||||
"message_template": "You have successfully deleted {{ user_name }} from {{ application_name }}",
|
"message_template": "You have successfully deleted {{ user_name }} from {{ application_name }}",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user