mirror of
https://github.com/reddit-archive/reddit.git
synced 2026-04-27 03:00:12 -04:00
Don't modify traffic dates if there is no traffic history.
This commit is contained in:
@@ -640,9 +640,10 @@ class PromotedLinkTraffic(Templated):
|
||||
|
||||
# Check date of latest traffic (campaigns can end early).
|
||||
history = get_promo_traffic(thing, start, end)
|
||||
end = max(date for date, data in history)
|
||||
end = end.replace(tzinfo=g.tz) # get_promo_traffic returns tz naive
|
||||
# datetimes but is actually g.tz
|
||||
if history:
|
||||
end = max(date for date, data in history)
|
||||
end = end.replace(tzinfo=g.tz) # get_promo_traffic returns tz naive
|
||||
# datetimes but is actually g.tz
|
||||
|
||||
if self.period:
|
||||
display_start = self.after
|
||||
|
||||
Reference in New Issue
Block a user