app/projrev/views/proposal.py
changeset 6 17cab73c49eb
parent 5 88ae12bc6280
child 8 294ff7ac9cb6
--- a/app/projrev/views/proposal.py	Thu Aug 06 18:38:54 2009 +0530
+++ b/app/projrev/views/proposal.py	Thu Aug 06 19:10:03 2009 +0530
@@ -14,16 +14,15 @@
 from django.core.urlresolvers import reverse
 from django.http import HttpResponseRedirect
 from django.shortcuts import render_to_response, get_object_or_404
+from django.template import RequestContext
 
 from projrev.models import Project
 from projrev.models import Proposal
 from projrev.views.helpers import access 
 from projrev.views.helpers import forms as projrev_forms
 
-rights = {}
-rights['getMicr'] = 'proposer'
 
-
+@access.checkAccess
 def getMicr(request):
   """View to get MICR Code from the user.
   """
@@ -46,7 +45,8 @@
             context = {
                 'error': True,
                 }
-            return render_to_response(template, context)
+            return render_to_response(template,
+                                      RequestContext(request, context))
         else:
           if submit == 'Edit Proposal for MICR Code':
             return HttpResponseRedirect(
@@ -60,8 +60,10 @@
     template = 'projrev/proposal/get_micr.html'
     context = {}
 
-    return render_to_response(template, context)
+    return render_to_response(template, RequestContext(request, context))
 
+
+@access.checkAccess
 def submit(request, micr_code=None):
   """View for proposal submission.
   """
@@ -160,8 +162,9 @@
 
   template = 'projrev/proposal/submit.html'
 
-  return render_to_response(template, context)
+  return render_to_response(template, RequestContext(request, context))
 
+@access.checkAccess
 def withdraw(request, micr_code=None):
   """View Method for withdrawal of proposal.
   """
@@ -177,8 +180,9 @@
 
   template = 'projrev/proposal/withdraw.html'
 
-  return render_to_response(template, context)
+  return render_to_response(template, RequestContext(request, context))
 
+@access.checkAccess
 def review(request, micr_code=None):
   """View for reviewing the proposal.
   """
@@ -216,7 +220,7 @@
         'row_url': '/proposal/review/',
         }
 
-    return render_to_response(template, context)
+    return render_to_response(template, RequestContext(request, context))
 
   if not rev_form:
     rev_form = projrev_forms.ReviewForm()
@@ -235,8 +239,9 @@
 
   template = 'projrev/proposal/review.html'
 
-  return render_to_response(template, context)
+  return render_to_response(template, RequestContext(request, context))
 
+@access.checkAccess
 def rank(request, micr_code=None):
   """
   """
@@ -263,7 +268,7 @@
         'row_url': '/proposal/rank/',
         }
 
-    return render_to_response(template, context)
+    return render_to_response(template, RequestContext(request, context))
 
   projects = Project.objects.get(micr_code=micr_code)
 
@@ -297,4 +302,4 @@
 
   template = 'projrev/proposal/rank.html'
 
-  return render_to_response(template, context)
+  return render_to_response(template, RequestContext(request, context))