Remove pledge form error when campaign is not active. [#56565596]

pull/1/head
eric 2013-09-09 09:54:16 -04:00
parent 5c8b67a1c9
commit 63f0ee3794
2 changed files with 7 additions and 2 deletions

View File

@ -69,6 +69,11 @@
<br /> You can modify your pledge below.
</div>
{% endif %}
{% ifnotequal work.last_campaign.status 'ACTIVE' %}
<div class="clearfix"><h4>Campaign NOT ACTIVE</h4>
This pledge form is not functional because the campaign is NOT ACTIVE.<br /><br /><br />
</div>
{% endifnotequal %}
{% comment %}
Even there is a CampaignPledgeForm in frontend/forms.py , the "widget" for premium_id is implemented in HTML here for now.

View File

@ -965,7 +965,7 @@ class PledgeView(FormView):
campaign = None
work = None
premiums = None
data = None
data = {}
def get_preapproval_amount(self):
preapproval_amount = self.request.REQUEST.get('preapproval_amount', None)
@ -1042,7 +1042,7 @@ class PledgeView(FormView):
'work':self.work,
'campaign':self.campaign,
'premiums':self.premiums,
'premium_id':self.data['premium_id'],
'premium_id':self.data.get('premium_id',None),
'faqmenu': 'modify' if self.transaction else 'pledge',
'transaction': self.transaction,
'tid': self.transaction.id if self.transaction else None,