Permalink
Browse files

Minor factorization.

  • Loading branch information...
1 parent 122020f commit 73f38eb4d15d3da4707d8637178334c2f105ca19 @aaugustin aaugustin committed Sep 6, 2013
Showing with 1 addition and 4 deletions.
  1. +1 −4 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.