Skip to content

Fall back to organization name for org-only contacts in search#669

Merged
jeremyzilar merged 1 commit intostagingfrom
BDMS-786-Company-Contact-Names
May 1, 2026
Merged

Fall back to organization name for org-only contacts in search#669
jeremyzilar merged 1 commit intostagingfrom
BDMS-786-Company-Contact-Names

Conversation

@jeremyzilar
Copy link
Copy Markdown
Contributor

@jeremyzilar jeremyzilar commented May 1, 2026

Summary

  • Org-only contacts (those with organization set but no name) were returning a null label in search results, causing them to appear with a blank title in the search modal.
  • _get_contact_results in api/search.py now uses c.name or c.organization so org-only contacts surface with their organization name.

Part of

This is the API half of a two-repo fix for empty contact display names. The UI half (OcotilloUI) adds a getContactDisplayName utility function and applies it to the wells list, well detail Contacts card, contacts list page, and contact show page.

See also: DataIntegrationGroup/OcotilloUI#275

Test plan

  • Search for a contact that has only an organization name (no personal name) and confirm it appears with the org name as the result title
  • Confirm contacts with a personal name still show the personal name as the result title
  • Confirm contacts with both name and organization show the personal name

Org-only contacts (no personal name) were returning a null label in
search results. Use c.name or c.organization so those contacts appear
with their organization name instead of a blank title.
@jeremyzilar jeremyzilar merged commit 85e626e into staging May 1, 2026
8 checks passed
@jeremyzilar jeremyzilar deleted the BDMS-786-Company-Contact-Names branch May 1, 2026 16:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants