Skip to content

Commit 039564f

Browse files
authored
Fix onboarding orphan prospect query (#349)
1 parent 7167b7a commit 039564f

2 files changed

Lines changed: 5 additions & 3 deletions

File tree

apps/api/src/five08/backend/api.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2404,7 +2404,7 @@ def _list_dashboard_orphan_intake_submissions(
24042404
WHERE lower(people.email) = onboarding_intake_submissions.email
24052405
AND people.sync_status = 'active'
24062406
AND people.is_member = false
2407-
AND people.contact_type ILIKE '%prospect%'
2407+
AND people.contact_type ILIKE %s
24082408
AND (
24092409
people.onboarding_state IS NULL
24102410
OR replace(
@@ -2420,7 +2420,7 @@ def _list_dashboard_orphan_intake_submissions(
24202420
)
24212421
""",
24222422
]
2423-
params: list[Any] = []
2423+
params: list[Any] = ["%prospect%"]
24242424

24252425
if normalized_query:
24262426
conditions.append(f"{_ORPHAN_INTAKE_SEARCH_SQL} ILIKE %s")

tests/unit/test_backend_api.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3463,7 +3463,9 @@ def test_list_dashboard_onboarding_includes_orphan_intake_without_raw_payload()
34633463
orphan_sql = cursor.execute.call_args_list[1].args[0]
34643464
assert "raw_payload" not in people_sql
34653465
assert "people.sync_status = 'active'" in orphan_sql
3466-
assert "people.contact_type ILIKE '%prospect%'" in orphan_sql
3466+
orphan_params = cursor.execute.call_args_list[1].args[1]
3467+
assert "people.contact_type ILIKE %s" in orphan_sql
3468+
assert orphan_params[0] == "%prospect%"
34673469

34683470

34693471
def test_list_dashboard_onboarding_merges_orphans_before_applying_limit() -> None:

0 commit comments

Comments
 (0)