Fixes #20221: JSON CustomField does not coerce {} to null #1314

Closed
opened 2026-04-05 23:19:53 +02:00 by MrUnknownDE · 0 comments
Owner

Originally created by @jnovinger on 9/5/2025

Fixes: #20221

This fix actually fixes this for all valid JSON values that evaluate to False in Python when loaded and cast to bool:
bool(json.loads(<val>)).

  • {}
  • []
  • 0
  • False

This does not change the behavior of () or "" which are both explicitly cited as "empty" values on JSONField.

*Originally created by @jnovinger on 9/5/2025* ### Fixes: #20221 This fix actually fixes this for all valid JSON values that evaluate to `False` in Python when loaded and cast to bool: `bool(json.loads(<val>))`. - `{}` - `[]` - `0` - `False` This does not change the behavior of `()` or `""` which are both explicitly cited as "empty" values on `JSONField`.
Sign in to join this conversation.
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github/netbox#1314