Skip to content

Commit

Permalink
Fix the rest of the flake8 errors.
Browse files Browse the repository at this point in the history
  • Loading branch information
Omer Katz committed Nov 24, 2017
1 parent b235546 commit 5867895
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions celery/app/trace.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,8 @@ def get_log_policy(task, einfo, exc):

def get_task_name(request, default):
"""Use 'shadow' in request for the task name if applicable."""
# request.shadow could be None or an empty string. If so, we should use default.
# request.shadow could be None or an empty string.
# If so, we should use default.
return getattr(request, 'shadow', None) or default


Expand Down Expand Up @@ -450,8 +451,10 @@ def trace_task(uuid, args, kwargs, request=None):
send_success(sender=task, result=retval)
if _does_info:
info(LOG_SUCCESS, {
'id': uuid, 'name': get_task_name(task_request, name),
'return_value': Rstr, 'runtime': T,
'id': uuid,
'name': get_task_name(task_request, name),
'return_value': Rstr,
'runtime': T,
})

# -* POST *-
Expand Down

0 comments on commit 5867895

Please sign in to comment.