#36453: 5.2.3 introduces a regression when using `Value(None,
output_field=JSONField()` in a `When` clause.
-------------------------------------+-------------------------------------
Reporter: Thomas | Owner: (none)
Type: Bug | Status: new
Component: Database layer | Version: 5.2
(models, ORM) |
Severity: Release blocker | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Clifford Gama):
* resolution: duplicate =>
* severity: Normal => Release blocker
* stage: Unreviewed => Accepted
* status: closed => new
Comment:
This is indeed a regression in c1fa3fdd040718356e5a3b9a0fe699d73f47a940.
The problem is that we are now passing on `for_save` to `Case`'s source
expressions, and resolving `When.condition` with `for_save=True`.
The issue is related to #36445 in that they both expose problems related
to the use of `Value(None, JSONField())` to mean `JSON null` and None to
mean `NULL`, and how that is implemented depending on whether
`JSONFIeld.get_db_prep_save` is called. I think these set of tickets
should be an argument in favour of introducing a `JSONNull` value as
outlined in ticket:35381#comment:5.
--
Ticket URL: <https://code.djangoproject.com/ticket/36453#comment:4>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion visit
https://groups.google.com/d/msgid/django-updates/010701976397585b-8f67d04e-980f-440a-8913-7ae1075800d6-000000%40eu-central-1.amazonses.com.