diff --git a/atst/routes/workspaces/invitations.py b/atst/routes/workspaces/invitations.py index e1396c1e..8e609f88 100644 --- a/atst/routes/workspaces/invitations.py +++ b/atst/routes/workspaces/invitations.py @@ -39,7 +39,7 @@ 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) + send_invite_email(g.current_user.full_name, invite.token, invite.email) return redirect( url_for( "workspaces.workspace_members", diff --git a/atst/routes/workspaces/members.py b/atst/routes/workspaces/members.py index 92c3c380..6507329f 100644 --- a/atst/routes/workspaces/members.py +++ b/atst/routes/workspaces/members.py @@ -73,10 +73,8 @@ def create_member(workspace_id): if form.validate(): try: new_member = Workspaces.create_member(user, workspace, form.data) - invite = Invitations.create(user, new_member) - send_invite_email( - g.current_user.full_name, invite.token, new_member.user.email - ) + invite = Invitations.create(user, new_member, form.data["email"]) + send_invite_email(g.current_user.full_name, invite.token, invite.email) return redirect( url_for( diff --git a/tests/routes/test_workspaces_invitations.py b/tests/routes/workspaces/test_invitations.py similarity index 99% rename from tests/routes/test_workspaces_invitations.py rename to tests/routes/workspaces/test_invitations.py index 0e48dd85..c981cb72 100644 --- a/tests/routes/test_workspaces_invitations.py +++ b/tests/routes/workspaces/test_invitations.py @@ -179,6 +179,7 @@ def test_resend_invitation_sends_email(client, user_session, queue): assert len(queue.get_queue()) == 1 + def test_existing_member_invite_resent_to_email_submitted_in_form( client, user_session, queue ): diff --git a/tests/routes/test_workspaces_members.py b/tests/routes/workspaces/test_members.py similarity index 100% rename from tests/routes/test_workspaces_members.py rename to tests/routes/workspaces/test_members.py diff --git a/tests/routes/test_workspaces_projects.py b/tests/routes/workspaces/test_projects.py similarity index 100% rename from tests/routes/test_workspaces_projects.py rename to tests/routes/workspaces/test_projects.py diff --git a/tests/routes/test_workspaces.py b/tests/routes/workspaces/test_workspaces.py similarity index 100% rename from tests/routes/test_workspaces.py rename to tests/routes/workspaces/test_workspaces.py