From 14de65816f96ee61911519757b5ae41a91d272a8 Mon Sep 17 00:00:00 2001 From: Kenneth Kehl <@kkehl@flexion.us> Date: Mon, 7 Apr 2025 12:27:59 -0700 Subject: [PATCH] fix invites --- app/delivery/send_to_providers.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/app/delivery/send_to_providers.py b/app/delivery/send_to_providers.py index cecddd98b..9f0513c85 100644 --- a/app/delivery/send_to_providers.py +++ b/app/delivery/send_to_providers.py @@ -186,7 +186,15 @@ def send_email_to_provider(notification): personalisation = redis_store.get(f"email-personalisation-{notification.id}") if personalisation: personalisation = personalisation.decode("utf-8") - notification.personalisation = json.loads(personalisation) + p = json.loads(personalisation) + if os.get("NOTIFY_ENVIRONMENT") == "staging": + current_app.logger.info(f"Invite personalization before {p}") + p = p.replace("%5B", "") + p = p.replace("%5D", "") + if os.get("NOTIFY_ENVIRONMENT") == "staging": + current_app.logger.info(f"Invite personalization after {p}") + + notification.personalisation = p service = SerialisedService.from_id(notification.service_id) if not service.active: