app/projrev/views/proposal.py
changeset 19 0c9bdcfac9f7
parent 18 05b9e60e6a10
child 21 153db75bb515
--- a/app/projrev/views/proposal.py	Sat Aug 08 23:54:36 2009 +0530
+++ b/app/projrev/views/proposal.py	Sun Aug 09 12:39:51 2009 +0530
@@ -143,9 +143,9 @@
     return HttpResponseRedirect(
         reverse('app.projrev.views.proposal.submit', args=(micr_code,)))
 
-  return HttpResponseRedirect('')
+  return submitGet(request, micr_code, prop_form)
 
-def submitGet(request, micr_code=None):
+def submitGet(request, micr_code=None, prop_form=None):
   """Handles GET request for the submission of proposal form.
   """
 
@@ -161,8 +161,9 @@
         'state': Project.getStateCode(project.state),
         'district': Project.getDistrictCode(project.district),
         }
-    prop_form = projrev_forms.ProposalForm(
-        initial=initial_vals, instance=project)
+    if not prop_form:
+      prop_form = projrev_forms.ProposalForm(
+          initial=initial_vals, instance=project)
 
     proposal = project.proposal_set.all().order_by('-submitted_on')[0]
 
@@ -193,7 +194,8 @@
       context['nr_reviews'] = len(reviews)
  
   else:
-    prop_form = projrev_forms.ProposalForm()
+    if not prop_form:
+      prop_form = projrev_forms.ProposalForm()
 
   context['form'] = prop_form