# HG changeset patch # User nishanth # Date 1267389540 -19800 # Node ID 52958289d81f8530d5c619c1c496fb1982cb4e42 # Parent 420f974328cc3f3a222683219195f5c7af51ab36 now if a task has subs, it will remain locked forever. diff -r 420f974328cc -r 52958289d81f taskapp/utilities/task.py --- a/taskapp/utilities/task.py Sun Feb 28 22:58:58 2010 +0530 +++ b/taskapp/utilities/task.py Mon Mar 01 02:09:00 2010 +0530 @@ -27,8 +27,10 @@ deps, subs = task.deps, task.subs if deps and task.status in ["OP", "LO"]: task.status = "OP" if all(map(lambda t:t.status=="CM",deps)) else "LO" - if subs and task.status in ["OP", "LO", "CM"]: - task.status = "CM" if all(map(lambda t:t.status=="CM",subs)) else "LO" + + ## a task with subs will remain in "LO" and will be made "OP" only if all subs are removed. + if subs and task.status in ["OP", "LO"]: + task.status = "LO" task.save() return task diff -r 420f974328cc -r 52958289d81f taskapp/views/task.py --- a/taskapp/views/task.py Sun Feb 28 22:58:58 2010 +0530 +++ b/taskapp/views/task.py Mon Mar 01 02:09:00 2010 +0530 @@ -63,13 +63,11 @@ if task.status == "DL": return show_msg(user, 'This task no longer exists', '/task/browse/','browse the tasks') - comments = task.comment_set.filter(is_deleted=False) + comments = task.comment_set.filter(is_deleted=False).order_by('creation_datetime') mentors = task.mentors.all() deps, subs = task.deps, task.subs - errors = [] - is_guest = True if not user.is_authenticated() else False is_mentor = True if user in task.mentors.all() else False context = {'user':user, @@ -80,11 +78,10 @@ 'deps':deps, 'is_guest':is_guest, 'is_mentor':is_mentor, - 'errors':errors, } context['can_publish'] = True if task.status == "UP" and user == task.created_by else False - context['task_viewable'] = True if ( task.status != "DL" ) or is_mentor else False + context['task_viewable'] = True if ( task.status != "UP" ) or is_mentor else False context['task_claimable'] = True if task.status in ["OP", "WR"] else False context['can_mod_mentors'] = True if task.status in ["UP", "OP", "LO", "WR"] and is_mentor else False