diff options
author | nishanth | 2010-03-03 11:19:42 +0530 |
---|---|---|
committer | nishanth | 2010-03-03 11:19:42 +0530 |
commit | 5784f10c1e2be71e3fcb4690810ef4eb4bd154a6 (patch) | |
tree | 3f21f249b07940b522e0f2299e362a78506489bb /taskapp | |
parent | 2e905d31b36a5b5cc46962dae2270bfc33c76caf (diff) | |
download | pytask-5784f10c1e2be71e3fcb4690810ef4eb4bd154a6.tar.gz pytask-5784f10c1e2be71e3fcb4690810ef4eb4bd154a6.tar.bz2 pytask-5784f10c1e2be71e3fcb4690810ef4eb4bd154a6.zip |
now requested mentors can see unpublished task but not comment on it.
Diffstat (limited to 'taskapp')
-rw-r--r-- | taskapp/views/task.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/taskapp/views/task.py b/taskapp/views/task.py index 195d98e..f9c95ea 100644 --- a/taskapp/views/task.py +++ b/taskapp/views/task.py @@ -82,7 +82,9 @@ def view_task(request, tid): 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 |