FIX12: Make all search accent and case insensitive - #445
Open
gerardm27 wants to merge 9 commits into
Open
Conversation
The 60% coverage gate was already failing on the adding-tests base branch (55.56%). Adds flow tests for signup, login, logout, password reset, email activation, and verification views, lifting total coverage to 60.77%. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
gerardm27
force-pushed
the
fix-accent-agnostic-search
branch
from
August 24, 2026 08:59
f89cf20 to
b638427
Compare
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
gerardm27
force-pushed
the
fix-accent-agnostic-search
branch
from
August 24, 2026 09:01
b638427 to
9fb7c29
Compare
Raises coverage from 60.6% to 68.3%: review voting (show next pending, skip, comment, mark dubious), director actions (invite, confirm, waitlist, batch invite, waitlist-all), all organizer list views with permission checks, and user profile. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Adds a bilateral unaccent lookup on CharField/TextField, backed by the postgres unaccent extension in prod and a Python-registered sqlite function in dev. All table search filters and admin search_fields now use field__unaccent__icontains, so queries match regardless of accents or case in either the query or the stored value. Also fixes two pre-existing broken admin searches: judging Room searched raw FKs (challenge, main_judge) and meals Eaten searched a nonexistent name field. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
gerardm27
force-pushed
the
fix-accent-agnostic-search
branch
from
August 24, 2026 09:12
9fb7c29 to
d3667a0
Compare
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Screen.Recording.2026-08-24.at.10.39.19.mov
What
Searching "Ma" now matches "Màdrid" (and searching "Màdrid" matches "Madrid") everywhere: all django-tables2 search filters, the hardware admin lending search, and every Django admin
search_fields.How
user/lookups.pyregisters a bilateralunaccenttransform onCharField/TextField(wired up inUserConfig.ready()). Bilateral means both the column and the query value are unaccented, and the existingicontainskeeps it case-insensitive.unaccentextension, created by migrationuser/0020_unaccent_extension(no-op on sqlite). Requires the extension to be available on the DB server — standard on Heroku/RDS.unaccentfunction (NFKD normalize + strip combining marks) is registered on every connection via theconnection_createdsignal.field__unaccent__icontains. Left alone:uuid__icontains(UUIDField) and judging'surl(accents don't apply).Drive-by fixes
Two admin searches were already broken and crashed on any query:
Roomsearched raw FKschallenge/main_judge→ nowchallenge__name__unaccent,main_judge__name__unaccentEatensearched a nonexistentnamefield → nowmeal__name__unaccentTesting
tests/test_unaccent_search.py: unaccented query matches accented name, accented+mixed-case query matches plain name, and fuzzy typo does not match.get_search_resultsof every registered ModelAdmin — all pass on sqlite.Not included
Fuzzy search ("mdrid" → "Madrid") — needs postgres
pg_trgmwith no sqlite equivalent; can be added prod-only later if wanted.