don't allow adding documents to cancelled proposals

This commit is contained in:
Luke Hatcher 2012-07-18 19:22:29 -04:00
parent 07e98036b7
commit 4be04a3800

View file

@ -282,6 +282,9 @@ def document_create(request, proposal_pk):
proposal = get_object_or_404(queryset, pk=proposal_pk) proposal = get_object_or_404(queryset, pk=proposal_pk)
proposal = ProposalBase.objects.get_subclass(pk=proposal.pk) proposal = ProposalBase.objects.get_subclass(pk=proposal.pk)
if proposal.cancelled:
return HttpResponseForbidden()
if request.method == "POST": if request.method == "POST":
form = SupportingDocumentCreateForm(request.POST, request.FILES) form = SupportingDocumentCreateForm(request.POST, request.FILES)
if form.is_valid(): if form.is_valid():