summaryrefslogtreecommitdiff
path: root/django
diff options
context:
space:
mode:
authorJacob Walls <jacobtylerwalls@gmail.com>2024-05-04 17:11:07 -0400
committerSarah Boyce <42296566+sarahboyce@users.noreply.github.com>2024-05-07 12:15:27 +0200
commitceea86baa36b91d0002911770340a2d7bd4f64b7 (patch)
tree2e0de1367b61fb44caef8834df45afe9d2a0a139 /django
parent34a503162fe222033a1cd3249bccad014fcd1d20 (diff)
Fixed #35425 -- Avoided INSERT with force_update and explicit pk.
Affected models where the primary key field is defined with a default or db_default, such as UUIDField.
Diffstat (limited to 'django')
-rw-r--r--django/db/models/base.py1
1 files changed, 1 insertions, 0 deletions
diff --git a/django/db/models/base.py b/django/db/models/base.py
index e68baf4e57..cd300e47bc 100644
--- a/django/db/models/base.py
+++ b/django/db/models/base.py
@@ -1088,6 +1088,7 @@ class Model(AltersData, metaclass=ModelBase):
if (
not raw
and not force_insert
+ and not force_update
and self._state.adding
and (
(meta.pk.default and meta.pk.default is not NOT_PROVIDED)