def get_updated_instructor_task(task_id):
 try:
  instructor_task = InstructorTask.objects.get(task_id=task_id)
 except InstructorTask.DoesNotExist:
  log.warning('query for InstructorTask status failed: task_id=(%s) not found', task_id)
  return None
 if (instructor_task.task_state not in READY_STATES):
  result = AsyncResult(task_id)
  _update_instructor_task(instructor_task, result)
 return instructor_task

def get_updated_instructor_task ( task_id ) : try : instructor_task = InstructorTask . objects . get ( task_id = task_id ) except InstructorTask . DoesNotExist : log . warning ( 'query for InstructorTask status failed: task_id=(%s) not found' , task_id ) return None if ( instructor_task . task_state not in READY_STATES ) : result = AsyncResult ( task_id ) _update_instructor_task ( instructor_task , result ) return instructor_task
returns instructortask object corresponding to a given task_id .