[#31605173] This plugs .../pledge/work_id where work_id tied to no campaign or a campaign that is not ACTIVE

pull/1/head
Raymond Yee 2012-06-21 10:16:51 -07:00
parent 4bb48c64e6
commit d37792c813
2 changed files with 9 additions and 3 deletions

View File

@ -56,5 +56,8 @@ class Command(BaseCommand):
# NONE status -- follow up on?
# tally up different classes of statuses we have for c3
# who has modified a transaction and never cancelled it?

View File

@ -552,9 +552,12 @@ class PledgeView(FormView):
work = get_object_or_404(models.Work, id=self.kwargs["work_id"])
campaign = work.last_campaign()
if campaign:
premiums = campaign.effective_premiums()
# if there is no campaign or if campaign is not active, we should raise an error
if campaign is None or campaign.status != 'ACTIVE':
raise Http404
premiums = campaign.effective_premiums()
premium_id = self.request.REQUEST.get('premium_id', None)
preapproval_amount = self.request.REQUEST.get('preapproval_amount', None)