Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Minor factorization.

  • Loading branch information...
commit 73f38eb4d15d3da4707d8637178334c2f105ca19 1 parent 122020f
@aaugustin aaugustin authored
Showing with 1 addition and 4 deletions.
  1. +1 −4 django/db/models/sql/subqueries.py
View
5 django/db/models/sql/subqueries.py
@@ -153,10 +153,7 @@ def add_related_update(self, model, field, value):
Updates are coalesced so that we only run one update query per ancestor.
"""
- try:
- self.related_updates[model].append((field, None, value))
- except KeyError:
- self.related_updates[model] = [(field, None, value)]
+ self.related_updates.setdefault(model, []).append((field, None, value))
def get_related_updates(self):
"""

0 comments on commit 73f38eb

Please sign in to comment.
Something went wrong with that request. Please try again.