Skip to content

Commit

Permalink
Fixed Tag model's random method to never return entries which have no…
Browse files Browse the repository at this point in the history
…t yet reached their publishing datetime.
  • Loading branch information
lethain committed Jan 18, 2009
1 parent 85cf71c commit da944b4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion models.py
Expand Up @@ -490,7 +490,7 @@ def get_absolute_url(self):
return u"/tags/%s/" % self.slug

def random(self):
return self.entry_set.all().order_by('?')
return self.entry_set.filter(**{'pub_date__lte': datetime.datetime.now()}).order_by('?')

def latest(self, qty=None):
if qty is None:
Expand Down

0 comments on commit da944b4

Please sign in to comment.