Skip to content

[crud] Avoid 500 when filtering a list on a ChoiceType column#1155

Merged
frankrousseau merged 1 commit into
cgwire:mainfrom
frankrousseau:fix-crud-filter-choicetype
Jul 10, 2026
Merged

[crud] Avoid 500 when filtering a list on a ChoiceType column#1155
frankrousseau merged 1 commit into
cgwire:mainfrom
frankrousseau:fix-crud-filter-choicetype

Conversation

@frankrousseau

Copy link
Copy Markdown
Contributor

Problems

  • A CRUD list filter on a ChoiceType/LocaleType/TimezoneType column (e.g. GET /data/persons?role=admin) crashed with a 500 because those types raise NotImplementedError for python_type.

Solutions

  • Treat a missing python_type as the generic case and fall through to the default cast.

cast_value read field_key.type.python_type unconditionally, but types
like ChoiceType, LocaleType and TimezoneType raise NotImplementedError
for it, so a CRUD list filter on such a column (e.g. GET /data/persons
?role=admin) crashed with a 500. Treat a missing python_type as the
generic case and fall through to the default cast.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@frankrousseau
frankrousseau merged commit 315a408 into cgwire:main Jul 10, 2026
14 checks passed
@frankrousseau
frankrousseau deleted the fix-crud-filter-choicetype branch July 10, 2026 12:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant