Display an alert when invitations are resent
This commit is contained in:
parent
f6b4b2444f
commit
78e34d4ddd
@ -85,3 +85,7 @@ class Invitation(Base, TimestampsMixin, AuditableMixin):
|
||||
@property
|
||||
def user_email(self):
|
||||
return self.workspace_role.user.email
|
||||
|
||||
@property
|
||||
def user_name(self):
|
||||
return self.workspace_role.user.full_name
|
||||
|
@ -103,6 +103,7 @@ def show_workspace(workspace_id):
|
||||
def workspace_members(workspace_id):
|
||||
workspace = Workspaces.get_with_members(g.current_user, workspace_id)
|
||||
new_member_name = http_request.args.get("newMemberName")
|
||||
resent_invitation_to = http_request.args.get("resentInvitationTo")
|
||||
new_member = next(
|
||||
filter(lambda m: m.user_name == new_member_name, workspace.members), None
|
||||
)
|
||||
@ -127,6 +128,7 @@ def workspace_members(workspace_id):
|
||||
status_choices=MEMBER_STATUSES,
|
||||
members=members_list,
|
||||
new_member=new_member,
|
||||
resent_invitation_to=resent_invitation_to,
|
||||
)
|
||||
|
||||
|
||||
@ -380,4 +382,10 @@ def revoke_invitation(workspace_id, token):
|
||||
def resend_invitation(workspace_id, token):
|
||||
invite = Invitations.resend(g.current_user, workspace_id, token)
|
||||
send_invite_email(g.current_user.full_name, invite.token, invite.user_email)
|
||||
return redirect(url_for("workspaces.workspace_members", workspace_id=workspace_id))
|
||||
return redirect(
|
||||
url_for(
|
||||
"workspaces.workspace_members",
|
||||
workspace_id=workspace_id,
|
||||
resentInvitationTo=invite.user_name,
|
||||
)
|
||||
)
|
||||
|
@ -33,6 +33,17 @@
|
||||
) }}
|
||||
{% endif %}
|
||||
|
||||
{% if resent_invitation_to %}
|
||||
{% set message -%}
|
||||
<p>Successfully sent a new invitation to {{ resent_invitation_to }}.</p>
|
||||
{%- endset %}
|
||||
|
||||
{{ Alert('Invitation resent',
|
||||
message=message,
|
||||
level='success'
|
||||
) }}
|
||||
{% endif %}
|
||||
|
||||
{% set member_name = request.args.get("memberName") %}
|
||||
{% set updated_role = request.args.get("updatedRole") %}
|
||||
{% if updated_role %}
|
||||
|
Loading…
x
Reference in New Issue
Block a user