Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions apps/api/src/five08/backend/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -2404,7 +2404,7 @@ def _list_dashboard_orphan_intake_submissions(
WHERE lower(people.email) = onboarding_intake_submissions.email
AND people.sync_status = 'active'
AND people.is_member = false
AND people.contact_type ILIKE '%prospect%'
AND people.contact_type ILIKE %s
AND (
people.onboarding_state IS NULL
OR replace(
Expand All @@ -2420,7 +2420,7 @@ def _list_dashboard_orphan_intake_submissions(
)
""",
]
params: list[Any] = []
params: list[Any] = ["%prospect%"]

if normalized_query:
conditions.append(f"{_ORPHAN_INTAKE_SEARCH_SQL} ILIKE %s")
Expand Down
4 changes: 3 additions & 1 deletion tests/unit/test_backend_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -3463,7 +3463,9 @@ def test_list_dashboard_onboarding_includes_orphan_intake_without_raw_payload()
orphan_sql = cursor.execute.call_args_list[1].args[0]
assert "raw_payload" not in people_sql
assert "people.sync_status = 'active'" in orphan_sql
assert "people.contact_type ILIKE '%prospect%'" in orphan_sql
orphan_params = cursor.execute.call_args_list[1].args[1]
assert "people.contact_type ILIKE %s" in orphan_sql
assert orphan_params[0] == "%prospect%"


def test_list_dashboard_onboarding_merges_orphans_before_applying_limit() -> None:
Expand Down