Skip to content

Commit

Permalink
Fixes searches where no category is specified (#520)
Browse files Browse the repository at this point in the history
The conversion from an enumeration list failed when no category was
specified
  • Loading branch information
kevinschaper authored Dec 21, 2023
1 parent 49f34df commit c01f998
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion backend/src/monarch_py/api/search.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,11 @@ async def search(
EntityResults
"""
facet_fields = ["category", "in_taxon_label"]
if category is None:
category = []
response = solr().search(
q=q or "*:*",
category=[c.value if isinstance(c, EntityCategory) else c for c in category],
category=[c.value for c in category] if category else None,
in_taxon_label=in_taxon_label,
facet_fields=facet_fields,
offset=pagination.offset,
Expand Down

0 comments on commit c01f998

Please sign in to comment.