From 104cbfd44b9eff010daf0ef0e1ce434385855b13 Mon Sep 17 00:00:00 2001 From: Clifford Gama Date: Thu, 12 Jun 2025 09:35:07 +0200 Subject: Fixed #36453 -- Made When.condition resolve with for_save=False. Value(None, JSONField()) when used in When.condition incorrectly resolved with for_save=True, resulting in the value being serialized as SQL NULL instead of JSON null. Regression in c1fa3fdd040718356e5a3b9a0fe699d73f47a940. Thanks to Thomas McKay for the report, and to David Sanders and Simon Charettes for the review. Co-authored-by: Sarah Boyce <42296566+sarahboyce@users.noreply.github.com> --- docs/releases/5.2.4.txt | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'docs') diff --git a/docs/releases/5.2.4.txt b/docs/releases/5.2.4.txt index ebfa556f23..521ed94d6c 100644 --- a/docs/releases/5.2.4.txt +++ b/docs/releases/5.2.4.txt @@ -12,3 +12,7 @@ Bugfixes * Fixed a regression in Django 5.2.2 where :meth:`HttpRequest.get_preferred_type() ` incorrectly preferred more specific media types with a lower quality (:ticket:`36447`). + +* Fixed a regression in Django 5.2.3 where ``Value(None, JSONField())`` used in + a :class:`~django.db.models.expressions.When` condition was incorrectly + serialized as SQL ``NULL`` instead of JSON ``null`` (:ticket:`36453`). -- cgit v1.3