summaryrefslogtreecommitdiff
path: root/taskapp/views/task.py
diff options
context:
space:
mode:
authornishanth2010-03-01 05:46:13 +0530
committernishanth2010-03-01 05:46:13 +0530
commitf9219059285e024c70c50ee4ade9053ed23934d7 (patch)
treef56eec26f2a4fa911c2cf109d097f4be31d27605 /taskapp/views/task.py
parentdb389ba427b1b918b125edb85741cb658458afcf (diff)
downloadpytask-f9219059285e024c70c50ee4ade9053ed23934d7.tar.gz
pytask-f9219059285e024c70c50ee4ade9053ed23934d7.tar.bz2
pytask-f9219059285e024c70c50ee4ade9053ed23934d7.zip
imposed a constraint that edit_task url is not displayed if task is OP and has claimed_users.
Diffstat (limited to 'taskapp/views/task.py')
-rw-r--r--taskapp/views/task.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/taskapp/views/task.py b/taskapp/views/task.py
index dc54292..20329bc 100644
--- a/taskapp/views/task.py
+++ b/taskapp/views/task.py
@@ -80,10 +80,12 @@ def view_task(request, tid):
'is_mentor':is_mentor,
}
+ claimed_users = task.claimed_users.all()
+
context['task_viewable'] = True if ( task.status != "UP" ) or is_mentor else False
context['can_publish'] = True if task.status == "UP" and user == task.created_by else False
- context['can_edit'] = True if task.status in ["UP", "LO", "OP"] and is_mentor else False
+ context['can_edit'] = True if ( not claimed_users ) and task.status in ["UP", "LO", "OP"] and is_mentor else False
context['can_close'] = True if task.status not in ["UP", "CD", "CM"] and is_mentor else False
context['can_mod_mentors'] = True if task.status in ["UP", "OP", "LO", "WR"] and is_mentor else False