From fe189dc43ab3eddbbceefb6834893b73ca60d5ed Mon Sep 17 00:00:00 2001 From: Nilesh Kumar Pahari Date: Mon, 26 Jan 2026 00:02:29 +0530 Subject: Fixed #36847 -- Ensured auto_now_add fields are set on pre_save(). Regression in 94680437a45a71c70ca8bd2e68b72aa1e2eff337. Refs #27222. During INSERT operations, `field.pre_save()` is called to prepare values for db insertion. The `add` param must be `True` for `auto_now_add` fields to be populated. The regression commit passed `False`, causing `auto_now_add` fields to remain `None` when used by other fields, such as `upload_to` callables. Thanks Ran Benita for the report. --- docs/releases/6.0.2.txt | 3 +++ 1 file changed, 3 insertions(+) (limited to 'docs') diff --git a/docs/releases/6.0.2.txt b/docs/releases/6.0.2.txt index b25f1af472..d74a8bd763 100644 --- a/docs/releases/6.0.2.txt +++ b/docs/releases/6.0.2.txt @@ -15,3 +15,6 @@ Bugfixes to wrap below the changelist when filter elements contained long text (:ticket:`36850`). +* Fixed a regression in Django 6.0 where ``auto_now_add`` field values were not + populated during ``INSERT`` operations, due to incorrect parameters passed to + ``field.pre_save()`` (:ticket:`36847`). -- cgit v1.3