Kaydet (Commit) 51d230e0 authored tarafından Tim Graham's avatar Tim Graham Kaydeden (comit) GitHub

Fixed #28675 -- Removed always True variable in SQLInsertCompiler.execute_sql() check.

Unused since 7deb25b8.
üst 491eb56f
...@@ -1262,7 +1262,7 @@ class SQLInsertCompiler(SQLCompiler): ...@@ -1262,7 +1262,7 @@ class SQLInsertCompiler(SQLCompiler):
with self.connection.cursor() as cursor: with self.connection.cursor() as cursor:
for sql, params in self.as_sql(): for sql, params in self.as_sql():
cursor.execute(sql, params) cursor.execute(sql, params)
if not (return_id and cursor): if not return_id:
return return
if self.connection.features.can_return_ids_from_bulk_insert and len(self.query.objs) > 1: if self.connection.features.can_return_ids_from_bulk_insert and len(self.query.objs) > 1:
return self.connection.ops.fetch_returned_insert_ids(cursor) return self.connection.ops.fetch_returned_insert_ids(cursor)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment