From 565ae5bb2fc0192efd356abbc49a57c2dc7f7edd Mon Sep 17 00:00:00 2001 From: bsimpson63 Date: Mon, 16 Jul 2012 16:19:37 -0400 Subject: [PATCH] Only show "view live" link on current live campaign. --- r2/r2/lib/promote.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/r2/r2/lib/promote.py b/r2/r2/lib/promote.py index 676f64dbf..b04371759 100644 --- a/r2/r2/lib/promote.py +++ b/r2/r2/lib/promote.py @@ -127,6 +127,12 @@ def is_live_on_sr(link, srname): return True return False + +def campign_is_live(link, campaign_index): + live = scheduled_campaigns_by_link(link) + return campaign_index in live + + # no references to promote_status below this function, pls def set_status(l, status, onchange = None): # keep this out here. Useful for updating the queue if there is a bug @@ -255,7 +261,7 @@ class RenderableCampaign(): time = ungettext("day", "days", ndays)) self.bid = "%.2f" % bid self.sr = sr - live = is_live_on_sr(link, sr) + live = campign_is_live(link, indx) self.status = dict(paid = bool(transaction), complete = False,