summaryrefslogtreecommitdiff
path: root/website/views.py
diff options
context:
space:
mode:
Diffstat (limited to 'website/views.py')
-rwxr-xr-xwebsite/views.py12
1 files changed, 9 insertions, 3 deletions
diff --git a/website/views.py b/website/views.py
index b516fad..96fa6bb 100755
--- a/website/views.py
+++ b/website/views.py
@@ -266,10 +266,14 @@ def edit_proposal(request, proposal_id = None):
if user.is_authenticated():
proposal = Proposal.objects.get(id=proposal_id)
if proposal.proposal_type == 'ABSTRACT':
- form = ProposalForm(request.POST, request.FILES, instance=proposal)
+ form = ProposalForm( instance=proposal)
else:
- form = WorkshopForm(request.POST, request.FILES, instance=proposal)
+ form = WorkshopForm( instance=proposal)
if request.method == 'POST':
+ if proposal.proposal_type == 'ABSTRACT':
+ form = ProposalForm( request.POST, request.FILES, instance=proposal)
+ else:
+ form = WorkshopForm( request.POST, request.FILES, instance=proposal)
if form.is_valid():
data = form.save(commit = False)
data.user = user
@@ -279,7 +283,9 @@ def edit_proposal(request, proposal_id = None):
return render(request, 'cfp.html')
else:
context['user'] = user
- return render(request, 'cfp.html', context)
+ context['form'] = form
+ context['proposal'] = proposal
+ return render(request, 'edit-proposal.html', context)
context['user'] = user
context['form'] = form
context['proposal'] = proposal