Skip to content

Commit

Permalink
fix: return empty result for URLs
Browse files Browse the repository at this point in the history
resolves #372
when a url is pasted to the autocomplete
just return an empty queryset to allow for
creation of the object.
  • Loading branch information
sennierer committed Nov 25, 2024
1 parent 1e21c2f commit 70597fc
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions apis_ontology/querysets.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ def InstitutionAutocompleteQueryset(model, query):
# calculate a rank based on the difference in length
# if the query is *not* contained in the result, we
# use the trigram similarity score
if query.startswith("http"):
return model.objects.none()
insitutions = (
model.objects.annotate(
icontains_rank=Case(
Expand Down

0 comments on commit 70597fc

Please sign in to comment.