Skip to content

Commit

Permalink
fix searching on empty catch names (#541)
Browse files Browse the repository at this point in the history
  • Loading branch information
flaree authored Feb 10, 2025
1 parent d0e37a0 commit e7ce3b3
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions ballsdex/core/utils/transformers.py
Original file line number Diff line number Diff line change
Expand Up @@ -182,8 +182,9 @@ async def get_options(
balls_queryset.select_related("ball")
.annotate(
searchable=RawSQL(
"to_hex(ballinstance.id) || ' ' || ballinstance__ball.country || "
"' ' || ballinstance__ball.catch_names"
"to_hex(ballinstance.id) || ' ' || ballinstance__ball.country || ' ' || "
"COALESCE(ballinstance__ball.catch_names, '') || ' ' || "
"COALESCE(ballinstance__ball.translations, '')"
)
)
.filter(searchable__icontains=value.replace(".", ""))
Expand Down

0 comments on commit e7ce3b3

Please sign in to comment.