1
0
mirror of https://github.com/django/django.git synced 2025-10-31 09:41:08 +00:00

[1.6.x] Fixed #21643 -- repeated execution of qs with F() + timedelta

Thanks Tim Graham for review and Tai Lee for the additional test to prove
this was a regression in 1.6.

Backport of 7f2485b4d1 and 8137215973 from master
This commit is contained in:
Alexey Voronov
2013-12-22 00:03:17 +02:00
committed by Tim Graham
parent f2b513c9e8
commit 5cda1d2702
3 changed files with 19 additions and 0 deletions

View File

@@ -108,6 +108,7 @@ class SQLEvaluator(object):
def evaluate_date_modifier_node(self, node, qn, connection):
timedelta = node.children.pop()
sql, params = self.evaluate_node(node, qn, connection)
node.children.append(timedelta)
if timedelta.days == 0 and timedelta.seconds == 0 and \
timedelta.microseconds == 0: