(task)
return messages, errors
for grouped celery tasks, append all results to the context
for grouped celery tasks, append all results to the context
for grouped celery tasks append all results to the context
def _get_download_context_multiple_tasks(task):
    """for grouped celery tasks, append all results to the context
    """
    results = task.results
    messages = []
    errors = []
    for result in results:
        try:
            task_result = result.get()
        except Exception as e:  # Celery raises whatever exception was thrown
                                # in the task when accessing the result
            errors.append(e)
        else:
            try:
                messages.append(task_result.get("messages"))
            except AttributeError:
                messages.append(str(task_result))

    return messages, errors
def _get_download_context_multiple_tasks ( task ) : results = task . results messages = [ ] errors = [ ] for result in results : try : task_result = result . get ( ) except Exception as e : # Celery raises whatever exception was thrown # in the task when accessing the result errors . append ( e ) else : try : messages . append ( task_result . get ( "messages" ) ) except AttributeError : messages . append ( str ( task_result ) ) return messages , errors