Skip to content

Commit

Permalink
Removed erroneous code in Spot.all_spot_copy(). Added keyword to
Browse files Browse the repository at this point in the history
method parameter in Spot.shuffle_spot_copies().
  • Loading branch information
prknndy committed Mar 14, 2014
1 parent 88d2ac2 commit f83b961
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions traffic_log/models.py
Expand Up @@ -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():
Expand Down Expand Up @@ -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).
Expand Down

0 comments on commit f83b961

Please sign in to comment.