From 3642835bde667dfaad0a5fea7242a289dd993701 Mon Sep 17 00:00:00 2001 From: Tim Graham Date: Sat, 14 May 2016 06:42:50 -0400 Subject: [PATCH] Removed redundant code in QuerySet._batched_insert(). --- django/db/models/query.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/django/db/models/query.py b/django/db/models/query.py index 1cf2a80994..dce643869e 100644 --- a/django/db/models/query.py +++ b/django/db/models/query.py @@ -1056,15 +1056,13 @@ class QuerySet(object): inserted_ids = [] for item in [objs[i:i + batch_size] for i in range(0, len(objs), batch_size)]: if connections[self.db].features.can_return_ids_from_bulk_insert: - inserted_id = self.model._base_manager._insert( - item, fields=fields, using=self.db, return_id=True - ) + inserted_id = self._insert(item, fields=fields, using=self.db, return_id=True) if len(objs) > 1: inserted_ids.extend(inserted_id) if len(objs) == 1: inserted_ids.append(inserted_id) else: - self.model._base_manager._insert(item, fields=fields, using=self.db) + self._insert(item, fields=fields, using=self.db) return inserted_ids def _clone(self, **kwargs):