--- a/app/projrev/views/proposal.py Wed Aug 12 19:30:12 2009 +0530
+++ b/app/projrev/views/proposal.py Wed Aug 12 22:41:21 2009 +0530
@@ -239,7 +239,11 @@
if rev_form.is_valid():
cleaned_data = rev_form.cleaned_data
- cleaned_data['project'] = Project.objects.get(micr_code=micr_code)
+ project = Project.objects.get(micr_code=micr_code)
+ proposal = project.proposal_set.all().order_by('-submitted_on')[0]
+
+ cleaned_data['project'] = project
+ cleaned_data['proposal'] = proposal
cleaned_data['reviewer'] = request.user
# If the form is valid create a new project or update the project
@@ -266,6 +270,10 @@
if not rev_form:
rev_form = projrev_forms.ReviewForm()
+ else:
+ context['prev_data'] = rev_form.data
+ import logging
+ logging.error(rev_form.data)
project = Project.objects.get(micr_code=micr_code)
context['form'] = rev_form