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,6 +17,7 @@ def bookpanel(context):
show_pledge = False show_pledge = False
if campaign and campaign.type==REWARDS: if campaign and campaign.type==REWARDS:
if campaign.status == 'ACTIVE':
if user.is_anonymous() or not user.id in context.get('supporters', []): if user.is_anonymous() or not user.id in context.get('supporters', []):
show_pledge = True show_pledge = True
context['show_pledge'] = show_pledge context['show_pledge'] = show_pledge
@ -31,6 +32,7 @@ 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 campaign.status == 'ACTIVE':
if not context.get('borrowable', False): if not context.get('borrowable', False):
if not library: if not library:
show_purchase = True show_purchase = True