taskapp/views/task.py
changeset 191 3bfe70742aa8
parent 181 be8ad7e26176
child 192 8c982f517786
--- a/taskapp/views/task.py	Wed Mar 03 05:36:21 2010 +0530
+++ b/taskapp/views/task.py	Wed Mar 03 11:19:42 2010 +0530
@@ -82,7 +82,9 @@
 
     claimed_users = task.claimed_users.all()
 
-    context['task_viewable'] = True if ( task.status != "UP" ) or is_mentor else False
+    task_viewable = True if ( task.status != "UP" ) or is_mentor or user.request_sent_to.filter(is_valid=True,is_replied=False,role="MT",task=task)else False 
+    if not task_viewable:
+        return show_msg(user, "You are not authorised to view this task", "/task/browse/", "browse the tasks")
 
     context['can_publish'] = True if task.status == "UP" and user == task.created_by else False
     context['can_edit'] = True if task.status == "UP" and is_mentor else False