diff --git a/django/db/models/sql/compiler.py b/django/db/models/sql/compiler.py index 251cc08e51..0d5cd764da 100644 --- a/django/db/models/sql/compiler.py +++ b/django/db/models/sql/compiler.py @@ -9,7 +9,6 @@ from django.db import DatabaseError, NotSupportedError from django.db.models.constants import LOOKUP_SEP from django.db.models.expressions import ColPairs, F, OrderBy, RawSQL, Ref, Value from django.db.models.fields import composite -from django.db.models.fields.composite import CompositePrimaryKey from django.db.models.functions import Cast, Random from django.db.models.lookups import Lookup from django.db.models.query_utils import select_related_descend @@ -1911,18 +1910,6 @@ class SQLInsertCompiler(SQLCompiler): ) ] cols = [field.get_col(opts.db_table) for field in self.returning_fields] - elif isinstance(opts.pk, CompositePrimaryKey): - returning_field = returning_fields[0] - cols = [returning_field.get_col(opts.db_table)] - rows = [ - ( - self.connection.ops.last_insert_id( - cursor, - opts.db_table, - returning_field.column, - ), - ) - ] else: cols = [opts.pk.get_col(opts.db_table)] rows = [ @@ -1937,8 +1924,6 @@ class SQLInsertCompiler(SQLCompiler): converters = self.get_converters(cols) if converters: rows = self.apply_converters(rows, converters) - if self.has_composite_fields(cols): - rows = self.composite_fields_to_tuples(rows, cols) return list(rows)