taskapp/events/task.py
changeset 53 2c5062a93734
parent 25 c0e4fc8b8b5b
child 54 943d682aefdd
--- 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