﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
28674	QuerySet._batched_insert() the caller ensures, that bool(objs) is True	Дилян Палаузов	nobody	"Only QuerySet.bulk_create() calls QuerySet._batched_insert() and the former ensures, that bool(obj-parameter) is True.

{{{
diff --git a/django/db/models/query.py b/django/db/models/query.py
--- a/django/db/models/query.py
+++ b/django/db/models/query.py
@@ -1129,10 +1129,8 @@ class QuerySet:
         """"""
         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.
+        _batched_insert() the remaining objects again.  bool(objs) must be True.
         """"""
-        if not objs:
-            return
         ops = connections[self.db].ops
         batch_size = (batch_size or max(ops.bulk_batch_size(fields, objs), 1))
         inserted_ids = []
}}}"	Cleanup/optimization	closed	Database layer (models, ORM)	dev	Normal	fixed			Ready for checkin	1	0	0	0	0	0
