Promotion date cutoff should be from now if promotion is still live.

This commit is contained in:
bsimpson63
2013-01-07 11:20:53 -05:00
parent c46cfb9918
commit 4d24eccce4

View File

@@ -470,6 +470,9 @@ class PromotedLinkTraffic(RedditTraffic):
self.history = []
return
now = datetime.datetime.utcnow().replace(minute=0, second=0,
microsecond=0)
end = min(end, now)
cutoff = end - datetime.timedelta(days=31)
start = max(start, cutoff)