From 61d294292bf605a531d5385f0f1f00d6ea14df33 Mon Sep 17 00:00:00 2001 From: Cliff Hill Date: Fri, 15 Dec 2023 13:14:53 -0500 Subject: [PATCH] Did stuff, fixed things. This seems to work now. Signed-off-by: Cliff Hill --- app/service_invite/rest.py | 2 ++ tests/app/service_invite/test_service_invite_rest.py | 7 ++++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/app/service_invite/rest.py b/app/service_invite/rest.py index 419713688..882c6e346 100644 --- a/app/service_invite/rest.py +++ b/app/service_invite/rest.py @@ -30,6 +30,7 @@ def _create_service_invite(invited_user, invite_link_host): template_id = current_app.config["INVITATION_EMAIL_TEMPLATE_ID"] template = dao_get_template_by_id(template_id) + service = Service.query.get(current_app.config["NOTIFY_SERVICE_ID"]) saved_notification = persist_notification( @@ -116,6 +117,7 @@ def resend_service_invite(service_id, invited_user_id): current_data = {k: v for k, v in invited_user_schema.dump(fetched).items()} update_dict = invited_user_schema.load(current_data) + save_invited_user(update_dict) _create_service_invite(fetched, current_app.config["ADMIN_BASE_URL"]) diff --git a/tests/app/service_invite/test_service_invite_rest.py b/tests/app/service_invite/test_service_invite_rest.py index fede2596f..e4ac9532c 100644 --- a/tests/app/service_invite/test_service_invite_rest.py +++ b/tests/app/service_invite/test_service_invite_rest.py @@ -203,7 +203,12 @@ def test_get_invited_user_by_service_when_user_does_not_belong_to_the_service( assert json_resp["result"] == "error" -def test_resend_expired_invite(client, sample_expired_user, mocker): +def test_resend_expired_invite( + client, + sample_expired_user, + invitation_email_template, + mocker, +): url = f"/service/{sample_expired_user.service_id}/invite/{sample_expired_user.id}/resend" mock_send = mocker.patch("app.service_invite.rest.send_notification_to_queue") mock_persist = mocker.patch("app.service_invite.rest.persist_notification")