summaryrefslogtreecommitdiff
path: root/tests/admin_scripts/complex_app/admin/__init__.py
diff options
context:
space:
mode:
authormlissner <mlissner@michaeljaylissner.com>2026-01-15 12:30:21 -0800
committerJacob Walls <jacobtylerwalls@gmail.com>2026-01-30 11:45:39 -0500
commit4cecf3039586ea738afafb9a28c946bff42c37c1 (patch)
tree5d822147b21b499494ceff4b533d32bd34fd2f76 /tests/admin_scripts/complex_app/admin/__init__.py
parentb25bc2441827a31b5629e9f79ad7296b992648a2 (diff)
Fixed #36865 -- Removed casting from exact lookups in admin searches.
Instead of casting non-text fields to CharField (which prevents index usage), skip exact lookups when the search term fails formfield.to_python(). This preserves index usage for valid searches while gracefully handling invalid search terms by simply not including them in the query for that field. For multi-term searches like 'foo 123' on search_fields=['name', 'age__exact']: - 'foo': invalid for age, so only name lookup is used - '123': valid for both, so both lookups are used This entails a slight increase in permissiveness for search terms that can be normalized by formfield.to_python().
Diffstat (limited to 'tests/admin_scripts/complex_app/admin/__init__.py')
0 files changed, 0 insertions, 0 deletions