Skip to content

Commit

Permalink
Handle promotions with 0 clicks.
Browse files Browse the repository at this point in the history
  • Loading branch information
bsimpson63 committed Jul 18, 2012
1 parent b5812e6 commit 52db26d
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions r2/r2/lib/pages/trafficpages.py
Expand Up @@ -354,6 +354,10 @@ def get_tables(self):
clicks = traffic.ClickthroughsByCodename.promotion_history(fullname,
start, end)

# promotion might have no clicks, zip_timeseries needs valid columns
if imps and not clicks:
clicks = [(imps[0][0], (0, 0))]

history = traffic.zip_timeseries(imps, clicks, order="ascending")
computed_history = []
self.total_impressions, self.total_clicks = 0, 0
Expand Down

0 comments on commit 52db26d

Please sign in to comment.