diff --git a/atst/routes/workspaces.py b/atst/routes/workspaces.py index 2a51f499..708ed89b 100644 --- a/atst/routes/workspaces.py +++ b/atst/routes/workspaces.py @@ -89,7 +89,14 @@ def show_workspace(workspace_id): @bp.route("/workspaces//members") def workspace_members(workspace_id): workspace = Workspaces.get_with_members(g.current_user, workspace_id) - return render_template("workspaces/members/index.html", workspace=workspace) + new_member_name = http_request.args.get("newMemberName") + new_member = next( + filter(lambda m: m.user_name == new_member_name, workspace.members), None + ) + + return render_template( + "workspaces/members/index.html", workspace=workspace, new_member=new_member + ) @bp.route("/workspaces//reports") diff --git a/templates/workspaces/members/index.html b/templates/workspaces/members/index.html index ecbb9067..90b650f5 100644 --- a/templates/workspaces/members/index.html +++ b/templates/workspaces/members/index.html @@ -20,11 +20,10 @@ {% else %} -{% set new_member_name = request.args.get("newMemberName") %} -{% if new_member_name %} +{% if new_member %} {% set message -%} -

{{ new_member_name }} was successfully invited via email to this workspace. They do not yet have access to any environments.

-

Add environment access.

+

{{ new_member.user_name }} was successfully invited via email to this workspace. They do not yet have access to any environments.

+

Add environment access.

{%- endset %} {{ Alert('Member added successfully',