summaryrefslogtreecommitdiff
path: root/taskapp
diff options
context:
space:
mode:
authornishanth2010-03-03 11:21:33 +0530
committernishanth2010-03-03 11:21:33 +0530
commit5b17cba84de5e04f97c89a831c56a915c71369d9 (patch)
tree21bfa729c71e92d7d6290b2df71ecf6e4e7f55b0 /taskapp
parent5784f10c1e2be71e3fcb4690810ef4eb4bd154a6 (diff)
downloadpytask-5b17cba84de5e04f97c89a831c56a915c71369d9.tar.gz
pytask-5b17cba84de5e04f97c89a831c56a915c71369d9.tar.bz2
pytask-5b17cba84de5e04f97c89a831c56a915c71369d9.zip
fixed a small syntax error .
Diffstat (limited to 'taskapp')
-rw-r--r--taskapp/views/task.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/taskapp/views/task.py b/taskapp/views/task.py
index f9c95ea..ffaa2e1 100644
--- a/taskapp/views/task.py
+++ b/taskapp/views/task.py
@@ -82,10 +82,14 @@ def view_task(request, tid):
claimed_users = task.claimed_users.all()
- 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
+
+ is_requested_mentor = True if user.request_sent_to.filter(is_valid=True,is_replied=False,role="MT",task=task) else False
+ task_viewable = True if ( task.status != "UP" ) or is_mentor or is_requested_mentor else False
if not task_viewable:
return show_msg(user, "You are not authorised to view this task", "/task/browse/", "browse the tasks")
+ context['is_requested_mentor'] = is_requested_mentor
+
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
context['can_close'] = True if task.status not in ["UP", "CD", "CM"] and is_mentor else False