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

API: GET /projects/{project}/files/ returns a 500 error #1047

Open
alex-ketch opened this issue Mar 3, 2021 · 0 comments
Open

API: GET /projects/{project}/files/ returns a 500 error #1047

alex-ketch opened this issue Mar 3, 2021 · 0 comments
Labels

Comments

@alex-ketch
Copy link
Contributor

While attempting to retrieve the list of files for a project, the latest version of the Hub (deployed and local) returns the following 500 error:

{
  message: "'int' object has no attribute 'id'",
  traceback: `Traceback (most recent call last):
File \"/hub/manager/venv/lib/python3.7/site-packages/rest_framework/views.py\", line 506, in dispatch
  response = handler(request, *args, **kwargs)
File \"/hub/manager/manager/api/helpers.py\", line 120, in list
  return self.get_paginated_response(serializer.data)
File \"/hub/manager/venv/lib/python3.7/site-packages/rest_framework/serializers.py\", line 745, in data
  ret = super().data
File \"/hub/manager/venv/lib/python3.7/site-packages/rest_framework/serializers.py\", line 246, in data
  self._data = self.to_representation(self.instance)
File \"/hub/manager/venv/lib/python3.7/site-packages/rest_framework/serializers.py\", line 664, in to_representation
  self.child.to_representation(item) for item in iterable
File \"/hub/manager/venv/lib/python3.7/site-packages/rest_framework/serializers.py\", line 664, in <listcomp>
  self.child.to_representation(item) for item in iterable
File \"/hub/manager/venv/lib/python3.7/site-packages/rest_framework/serializers.py\", line 515, in to_representation
  ret[field.field_name] = field.to_representation(attribute)
File \"/hub/manager/venv/lib/python3.7/site-packages/rest_framework/fields.py\", line 1870, in to_representation
  return method(value)
File \"/hub/manager/projects/api/serializers.py\", line 603, in get_source
  return [source.id for source in obj[\"source\"]]
File \"/hub/manager/projects/api/serializers.py\", line 603, in <listcomp>
  return [source.id for source in obj[\"source\"]]\nAttributeError: 'int' object has no attribute 'id'`,
}
@alex-ketch alex-ketch added the Bug label Mar 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant