taskapp/events/task.py
changeset 189 8f5fb15ffd9b
parent 167 b61e45074ba1
child 195 2717c8533322
equal deleted inserted replaced
188:e4e73a4dd720 189:8f5fb15ffd9b
     6 from pytask.taskapp.utilities.notification import create_notification
     6 from pytask.taskapp.utilities.notification import create_notification
     7 
     7 
     8 def publishTask(task, rem_mentors=True, rem_comments=True):
     8 def publishTask(task, rem_mentors=True, rem_comments=True):
     9     """ set the task status to open """
     9     """ set the task status to open """
    10 
    10 
    11     if task.sub_type == 'D':
    11  #   if task.sub_type == 'D':
    12         deps, subs = task.map_subs.all(), []
    12      #      deps, subs = task.map_subs.all(), []
    13     else:
    13      #else:
    14         subs, deps = task.map_subs.all(), []
    14          #   subs, deps = task.map_subs.all(), []
    15    
    15    
    16     if subs or any(map(lambda t:t.status!="CM",deps)):
    16     task = getTask(task.id)
       
    17     if task.subs or any(map(lambda t:t.status!="CM",task.deps)):
    17         task.status = "LO"
    18         task.status = "LO"
    18     else:
    19     else:
    19         task.status = "OP"
    20         task.status = "OP"
    20 
    21 
    21     if rem_mentors:
    22     if rem_mentors: