Skip to content
This repository has been archived by the owner on Feb 1, 2024. It is now read-only.

Commit

Permalink
Fix custom text handling when not in embed mode
Browse files Browse the repository at this point in the history
When not in embed mode just searching for free text was raising an exception
because `contributors` was None in `filter_by_query_params`.
  • Loading branch information
jwalgran committed Feb 23, 2022
1 parent 86f763e commit 8889d31
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/django/api/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -1254,7 +1254,10 @@ def filter_by_query_params(self, params):
facilities_qs = FacilityIndex.objects.all()

if free_text_query is not None:
custom_text = format_custom_text(contributors[0], free_text_query)
custom_text = (
format_custom_text(contributors[0], free_text_query)
if contributors
else free_text_query)
if switch_is_active('ppe'):
if embed is not None:
facilities_qs = facilities_qs \
Expand Down

0 comments on commit 8889d31

Please sign in to comment.