Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AttributeError: 'CustomTaskMetadata' object has no attribute 'task_name' #4323

Closed
bjester opened this issue Nov 1, 2023 · 0 comments · Fixed by #4333
Closed

AttributeError: 'CustomTaskMetadata' object has no attribute 'task_name' #4323

bjester opened this issue Nov 1, 2023 · 0 comments · Fixed by #4333
Assignees

Comments

@bjester
Copy link
Member

bjester commented Nov 1, 2023

Observed behavior

Requests to the sync endpoint fail when custom tasks have been invoked
Occurring on unstable branch

Traceback (most recent call last):
  File "/home/bjester/Projects/learningequality/pyenv/versions/studio-3.9.13/lib/python3.9/site-packages/django/core/handlers/exception.py", line 47, in inner
    response = get_response(request)
  File "/home/bjester/Projects/learningequality/pyenv/versions/studio-3.9.13/lib/python3.9/site-packages/django/core/handlers/base.py", line 181, in _get_response
    response = wrapped_callback(request, *callback_args, **callback_kwargs)
  File "/home/bjester/Projects/learningequality/pyenv/versions/studio-3.9.13/lib/python3.9/site-packages/django/views/decorators/csrf.py", line 54, in wrapped_view
    return view_func(*args, **kwargs)
  File "/home/bjester/Projects/learningequality/pyenv/versions/studio-3.9.13/lib/python3.9/site-packages/django/views/generic/base.py", line 70, in view
    return self.dispatch(request, *args, **kwargs)
  File "/home/bjester/Projects/learningequality/pyenv/versions/studio-3.9.13/lib/python3.9/site-packages/newrelic/hooks/component_djangorestframework.py", line 28, in _nr_wrapper_APIView_dispatch_
    return wrapped(*args, **kwargs)
  File "/home/bjester/Projects/learningequality/pyenv/versions/studio-3.9.13/lib/python3.9/site-packages/rest_framework/views.py", line 509, in dispatch
    response = self.handle_exception(exc)
  File "/home/bjester/Projects/learningequality/pyenv/versions/studio-3.9.13/lib/python3.9/site-packages/rest_framework/views.py", line 469, in handle_exception
    self.raise_uncaught_exception(exc)
  File "/home/bjester/Projects/learningequality/pyenv/versions/studio-3.9.13/lib/python3.9/site-packages/rest_framework/views.py", line 480, in raise_uncaught_exception
    raise exc
  File "/home/bjester/Projects/learningequality/pyenv/versions/studio-3.9.13/lib/python3.9/site-packages/rest_framework/views.py", line 506, in dispatch
    response = handler(request, *args, **kwargs)
  File "/home/bjester/Projects/learningequality/studio2/contentcuration/contentcuration/viewsets/sync/endpoint.py", line 179, in post
    response_payload.update(self.return_tasks(request, channel_revs))
  File "/home/bjester/Projects/learningequality/studio2/contentcuration/contentcuration/viewsets/sync/endpoint.py", line 151, in return_tasks
    "task_name": custom_task.task_name,
AttributeError: 'CustomTaskMetadata' object has no attribute 'task_name'

Expected behavior

Endpoint properly returns task results

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants