summaryrefslogtreecommitdiff
path: root/taskapp/views
diff options
context:
space:
mode:
authorNishanth Amuluru2011-01-06 00:15:17 +0530
committerNishanth Amuluru2011-01-06 00:15:17 +0530
commita495dcc55f091073554e8c962381687ac69ee3e0 (patch)
tree24985a2115483a726f76134e555e51eb0f635425 /taskapp/views
parent94562031fcfbf0b8cb9d8dcdcb275c893fe68095 (diff)
downloadpytask-a495dcc55f091073554e8c962381687ac69ee3e0.tar.gz
pytask-a495dcc55f091073554e8c962381687ac69ee3e0.tar.bz2
pytask-a495dcc55f091073554e8c962381687ac69ee3e0.zip
created form and created basic template for work report
Diffstat (limited to 'taskapp/views')
-rw-r--r--taskapp/views/task.py13
1 files changed, 9 insertions, 4 deletions
diff --git a/taskapp/views/task.py b/taskapp/views/task.py
index 9a956a6..b638fae 100644
--- a/taskapp/views/task.py
+++ b/taskapp/views/task.py
@@ -51,19 +51,24 @@ def upload_work(request, tid):
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)