From f83b96114e0797d8e615ce6ccbc1514c3d3ebbc2 Mon Sep 17 00:00:00 2001 From: Peter Kennedy Date: Thu, 13 Mar 2014 19:42:47 -0500 Subject: [PATCH] Removed erroneous code in Spot.all_spot_copy(). Added keyword to method parameter in Spot.shuffle_spot_copies(). --- traffic_log/models.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/traffic_log/models.py b/traffic_log/models.py index 445e822..9d4be49 100644 --- a/traffic_log/models.py +++ b/traffic_log/models.py @@ -122,7 +122,7 @@ def all_spot_copy(self, check_start_date=False): for c in AutoRetry(q): if not check_start_date or c.has_started(): active_spots.append(c) - active_spots = [c for c in AutoRetry(q)] + q = SpotCopy.all().filter("spot =", self).filter("expire_on >", datetime.datetime.now()) for c in AutoRetry(q): if not check_start_date or c.has_started(): @@ -179,7 +179,7 @@ def _expunge_unstarted_spot_copies(self, random_spot_copies): def shuffle_spot_copies(self, prev_spot_copy=None): """Shuffle list of spot copy keys associated with this spot.""" - spot_copies = [spot_copy.key() for spot_copy in self.all_spot_copy(True)] + spot_copies = [spot_copy.key() for spot_copy in self.all_spot_copy(check_start_date=True)] random.shuffle(spot_copies) # Get spot copies that have been read in the last period (two hours).