From 960def40be5370e617ad5893a3666c5dcf9b3ba4 Mon Sep 17 00:00:00 2001 From: Zach Aysan Date: Tue, 29 Oct 2024 10:14:48 -0400 Subject: [PATCH] feat: Log Hubspot cookie creation (#4778) --- api/integrations/lead_tracking/hubspot/client.py | 3 +++ .../lead_tracking/hubspot/test_unit_hubspot_client.py | 3 ++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/api/integrations/lead_tracking/hubspot/client.py b/api/integrations/lead_tracking/hubspot/client.py index ea5118c4f844..382c3eb7259a 100644 --- a/api/integrations/lead_tracking/hubspot/client.py +++ b/api/integrations/lead_tracking/hubspot/client.py @@ -53,6 +53,9 @@ def get_contact(self, user: FFAdminUser) -> None | dict[str, Any]: def create_lead_form( self, user: FFAdminUser, hubspot_cookie: str ) -> dict[str, Any]: + logger.info( + f"Creating Hubspot lead form for user {user.email} with hubspot cookie {hubspot_cookie}" + ) fields = [ { "objectTypeId": "0-1", diff --git a/api/tests/unit/integrations/lead_tracking/hubspot/test_unit_hubspot_client.py b/api/tests/unit/integrations/lead_tracking/hubspot/test_unit_hubspot_client.py index d76ebc7689e7..508c3c8d0f6c 100644 --- a/api/tests/unit/integrations/lead_tracking/hubspot/test_unit_hubspot_client.py +++ b/api/tests/unit/integrations/lead_tracking/hubspot/test_unit_hubspot_client.py @@ -72,8 +72,9 @@ def test_create_lead_form_error( # Then assert response == {"error": "Problem processing."} assert inspecting_handler.messages == [ + "Creating Hubspot lead form for user staff@example.com with hubspot cookie test_hubspot_cookie", "Problem posting data to Hubspot's form API due to 400 status code and following response: " - + '{"error": "Problem processing."}' + + '{"error": "Problem processing."}', ]