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