From a2626cb3fec2e67bb0ec4be2e992e1a836b7567e Mon Sep 17 00:00:00 2001 From: Tim Graham Date: Tue, 3 Oct 2017 19:56:44 -0400 Subject: [PATCH] Fixed #28674 -- Removed unused check in QuerySet._batched_insert(). --- django/db/models/query.py | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/django/db/models/query.py b/django/db/models/query.py index 140fff7ec73..b05497db7a0 100644 --- a/django/db/models/query.py +++ b/django/db/models/query.py @@ -1127,12 +1127,8 @@ class QuerySet: def _batched_insert(self, objs, fields, batch_size): """ - A helper method for bulk_create() to insert the bulk one batch at a - time. Insert recursively a batch from the front of the bulk and then - _batched_insert() the remaining objects again. + Helper method for bulk_create() to insert objs one batch at a time. """ - if not objs: - return ops = connections[self.db].ops batch_size = (batch_size or max(ops.bulk_batch_size(fields, objs), 1)) inserted_ids = []