# HG changeset patch # User nishanth # Date 1267402573 -19800 # Node ID 05157d35d66fd5870c20b155dcca90717dffcf55 # Parent a74a32a5a3e1bb8185b5e18f37634cee5fb669af imposed a constraint that edit_task url is not displayed if task is OP and has claimed_users. diff -r a74a32a5a3e1 -r 05157d35d66f 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