From 31a2af1c0101081a3950dab0e66fa41bbbf6d34f Mon Sep 17 00:00:00 2001 From: Tim Graham Date: Sat, 8 Jul 2017 08:12:46 -0400 Subject: [PATCH] Removed useless hasattr in UpdateQuery._setup_query(). The if statement always evaluates to True. --- django/db/models/sql/subqueries.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/django/db/models/sql/subqueries.py b/django/db/models/sql/subqueries.py index 0011a0dadd..1cb9aa9357 100644 --- a/django/db/models/sql/subqueries.py +++ b/django/db/models/sql/subqueries.py @@ -93,8 +93,7 @@ class UpdateQuery(Query): """ self.values = [] self.related_ids = None - if not hasattr(self, 'related_updates'): - self.related_updates = {} + self.related_updates = {} def clone(self, klass=None, **kwargs): return super().clone(klass, related_updates=self.related_updates.copy(), **kwargs)