From b010e9f3377ad3802915209c72868583674741a8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=95=BF=E5=AD=99=E5=BC=98=E5=A5=95?= Date: Wed, 8 May 2024 12:13:06 +0800 Subject: [PATCH] Update base.py --- django/db/models/base.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/django/db/models/base.py b/django/db/models/base.py index cd300e47bc..f0fd01cef0 100644 --- a/django/db/models/base.py +++ b/django/db/models/base.py @@ -1138,7 +1138,7 @@ class Model(AltersData, metaclass=ModelBase): for f in meta.local_concrete_fields if not f.generated and (pk_set or f is not meta.auto_field) ] - returning_fields = meta.db_returning_fields + returning_fields = [f for f in meta.db_returning_fields if not f.generated] results = self._do_insert( cls._base_manager, using, fields, returning_fields, raw )