updated publishtask event .
authornishanth
Tue, 23 Feb 2010 10:41:43 +0530
changeset 53 2c5062a93734
parent 52 0b73f0d8e06e
child 54 943d682aefdd
updated publishtask event .
taskapp/events/task.py
--- a/taskapp/events/task.py	Tue Feb 23 10:25:26 2010 +0530
+++ b/taskapp/events/task.py	Tue Feb 23 10:41:43 2010 +0530
@@ -4,7 +4,12 @@
 def publishTask(task):
     """ set the task status to open """
     
-    task.status = "OP"
+    sub_tasks = task.subs.all()
+    dependencies = task.deps.all()
+    if sub_tasks or any(map(lambda t:t.status!="CM",dependencies)):
+        task.status = "LO"
+    else:
+        task.status = "OP"
     task.save()
     return task