taskapp/views/task.py
changeset 221 a3de0d3c60a3
parent 220 807e4b701a20
child 222 eeef395a4e02
--- a/taskapp/views/task.py	Wed Jan 05 23:51:10 2011 +0530
+++ b/taskapp/views/task.py	Thu Jan 06 00:15:17 2011 +0530
@@ -51,19 +51,24 @@
     if not task.status == "WR":
         return show_msg(user, "The task is not in a stage to upload content", task_url, "view the task")
 
-    if not user in task.assigned_users.all():
-        return show_msg(user, "You are not authorised to upload data to this task", task_url, "view the task")
+    can_upload = True if user in task.assigned_users.all() else False
 
+    old_reports = WorkReport.workreport_report.all()
 
     context = {
-        'user':user,
-        'task':task,
+        'user': user,
+        'task': task,
+        'old_reports': old_reports,
     }
 
     if request.method == "POST":
+        if not can_upload:
+            return show_msg(user, "You are not authorised to upload data to this task", task_url, "view the task")
+
         pass
     else:
         form = WorkReportForm()
+        context.update("form":form)
         return render_to_response('task/report.html', context)