diff options
Diffstat (limited to 'django/db/models/sql')
| -rw-r--r-- | django/db/models/sql/subqueries.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/django/db/models/sql/subqueries.py b/django/db/models/sql/subqueries.py index b2810c8413..9cb971b38f 100644 --- a/django/db/models/sql/subqueries.py +++ b/django/db/models/sql/subqueries.py @@ -90,6 +90,10 @@ class UpdateQuery(Query): not (field.auto_created and not field.concrete) or not field.concrete ) model = field.model._meta.concrete_model + if field.name == "pk" and model._meta.is_composite_pk: + raise FieldError( + "Composite primary key fields must be updated individually." + ) if not direct or (field.is_relation and field.many_to_many): raise FieldError( "Cannot update model field %r (only non-relations and " |
