fixed pledge button showing for non-active campaigns

pull/1/head
eric 2013-12-25 17:38:27 -05:00
parent 3091651896
commit 1117ecd93a
1 changed files with 7 additions and 5 deletions

View File

@ -17,8 +17,9 @@ def bookpanel(context):
show_pledge = False show_pledge = False
if campaign and campaign.type==REWARDS: if campaign and campaign.type==REWARDS:
if user.is_anonymous() or not user.id in context.get('supporters', []): if campaign.status == 'ACTIVE':
show_pledge = True if user.is_anonymous() or not user.id in context.get('supporters', []):
show_pledge = True
context['show_pledge'] = show_pledge context['show_pledge'] = show_pledge
# compute a boolean that's true if bookpanel should show a "purchase" button... # compute a boolean that's true if bookpanel should show a "purchase" button...
@ -31,8 +32,9 @@ def bookpanel(context):
show_purchase = False show_purchase = False
if campaign and campaign.type==BUY2UNGLUE: if campaign and campaign.type==BUY2UNGLUE:
if user.is_anonymous() or not context.get('license_is_active', False): if user.is_anonymous() or not context.get('license_is_active', False):
if not context.get('borrowable', False): if campaign.status == 'ACTIVE':
if not library: if not context.get('borrowable', False):
show_purchase = True if not library:
show_purchase = True
context['show_purchase'] = show_purchase context['show_purchase'] = show_purchase
return '' return ''