From 63152780c2ac63437383de27560e57ca6b7e3527 Mon Sep 17 00:00:00 2001 From: rikuke <33894149+rikuke@users.noreply.github.com> Date: Thu, 15 Aug 2024 12:46:26 +0300 Subject: [PATCH] fix: truncate corporateName to 100 chars (#3213) --- backend/benefit/applications/services/ahjo_payload.py | 2 +- backend/benefit/applications/tests/conftest.py | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/backend/benefit/applications/services/ahjo_payload.py b/backend/benefit/applications/services/ahjo_payload.py index a709ab2e79..748500a0a6 100644 --- a/backend/benefit/applications/services/ahjo_payload.py +++ b/backend/benefit/applications/services/ahjo_payload.py @@ -113,7 +113,7 @@ def _prepare_top_level_dict( "Agents": [ { "Role": "sender_initiator", - "CorporateName": application.company.name, + "CorporateName": truncate_company_name(application.company.name, 100), "ContactPerson": application.contact_person, "Type": "External", "Email": application.company_contact_person_email, diff --git a/backend/benefit/applications/tests/conftest.py b/backend/benefit/applications/tests/conftest.py index 5feacfca69..94d2ef5327 100755 --- a/backend/benefit/applications/tests/conftest.py +++ b/backend/benefit/applications/tests/conftest.py @@ -27,7 +27,10 @@ from applications.services.ahjo_decision_service import ( replace_decision_template_placeholders, ) -from applications.services.ahjo_payload import resolve_payload_language +from applications.services.ahjo_payload import ( + resolve_payload_language, + truncate_company_name, +) from applications.services.application_alteration_csv_report import ( AlterationCsvConfigurableFields, ApplicationAlterationCsvService, @@ -435,7 +438,7 @@ def ahjo_open_case_top_level_dict(decided_application): "Agents": [ { "Role": "sender_initiator", - "CorporateName": application.company.name, + "CorporateName": truncate_company_name(application.company.name, 100), "ContactPerson": application.contact_person, "Type": "External", "Email": application.company_contact_person_email,