Skip to content

Commit

Permalink
Review fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
orf committed Sep 16, 2018
1 parent e78fafe commit 66f162c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion django/db/models/query.py
Expand Up @@ -486,7 +486,7 @@ def bulk_update(self, objs, fields, batch_size=None):
if not all(obj.pk for obj in objs):
raise ValueError('All objects must have a primary key set.')
fields = [self.model._meta.get_field(name) for name in fields]
if any(not f.concrete or (f.is_relation and f.many_to_many) for f in fields):
if any(not f.concrete or f.many_to_many for f in fields):
raise ValueError('bulk_update() can only be used with concrete fields.')
if any(f.primary_key for f in fields):
raise ValueError('bulk_update() cannot be used with primary key fields.')
Expand Down
2 changes: 1 addition & 1 deletion docs/ref/models/querysets.txt
Expand Up @@ -2090,7 +2090,7 @@ instance (if the database normally supports it).
The ``ignore_conflicts`` parameter was added.

``bulk_update()``
~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~

.. versionadded:: 2.2

Expand Down

0 comments on commit 66f162c

Please sign in to comment.