def get_public_task_data(request, task_id):
 try:
  (task, state, info) = get_task_data(task_id)
 except TaskNotFound:
  raise TaskNoPermission(task_id)
 if (not hasattr(task, 'check_permission')):
  raise TaskNoPermission(task_id)
 context = info.get('context', {})
 if (not task.check_permission(request, state, context)):
  raise TaskNoPermission(task_id)
 public_name = task.public_name
 return (public_name, state, info.get('public_data', {}), info.get('error', None))

def get_public_task_data ( request , task_id ) : try : ( task , state , info ) = get_task_data ( task_id ) except TaskNotFound : raise TaskNoPermission ( task_id ) if ( not hasattr ( task , 'check_permission' ) ) : raise TaskNoPermission ( task_id ) context = info . get ( 'context' , { } ) if ( not task . check_permission ( request , state , context ) ) : raise TaskNoPermission ( task_id ) public_name = task . public_name return ( public_name , state , info . get ( 'public_data' , { } ) , info . get ( 'error' , None ) )
return task details as tuple will raise tasknopermission if request has no permission to access info of the task with id task_id .