imposed a constraint that edit_task url is not displayed if task is OP and has claimed_users.
authornishanth
Mon, 01 Mar 2010 05:46:13 +0530
changeset 160 05157d35d66f
parent 159 a74a32a5a3e1
child 161 74ef330c9185
imposed a constraint that edit_task url is not displayed if task is OP and has claimed_users.
taskapp/views/task.py
--- a/taskapp/views/task.py	Mon Mar 01 05:41:12 2010 +0530
+++ b/taskapp/views/task.py	Mon Mar 01 05:46:13 2010 +0530
@@ -80,10 +80,12 @@
                '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