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

List index out of range in /api/v1/programme/1/ #737

Open
ansal opened this issue Sep 29, 2017 · 1 comment
Open

List index out of range in /api/v1/programme/1/ #737

ansal opened this issue Sep 29, 2017 · 1 comment
Assignees

Comments

@ansal
Copy link
Collaborator

ansal commented Sep 29, 2017

Traceback (most recent call last):
  File "/home/ubuntu/dubdubdub/venv/local/lib/python2.7/site-packages/django/core/handlers/base.py", line 111, in get_response
    response = wrapped_callback(request, *callback_args, **callback_kwargs)
  File "/home/ubuntu/dubdubdub/venv/local/lib/python2.7/site-packages/django/views/generic/base.py", line 69, in view
    return self.dispatch(request, *args, **kwargs)
  File "/home/ubuntu/dubdubdub/venv/local/lib/python2.7/site-packages/django/views/decorators/csrf.py", line 57, in wrapped_view
    return view_func(*args, **kwargs)
  File "/home/ubuntu/dubdubdub/venv/local/lib/python2.7/site-packages/rest_framework/views.py", line 400, in dispatch
    response = self.handle_exception(exc)
  File "/home/ubuntu/dubdubdub/venv/local/lib/python2.7/site-packages/rest_framework/views.py", line 397, in dispatch
    response = handler(request, *args, **kwargs)
  File "/home/ubuntu/dubdubdub/venv/local/lib/python2.7/site-packages/rest_framework/generics.py", line 425, in get
    return self.list(request, *args, **kwargs)
  File "/home/ubuntu/dubdubdub/venv/local/lib/python2.7/site-packages/rest_framework/mixins.py", line 98, in list
    return Response(serializer.data)
  File "/home/ubuntu/dubdubdub/venv/local/lib/python2.7/site-packages/rest_framework/serializers.py", line 575, in data
    self._data = self.to_native(obj)
  File "/home/ubuntu/dubdubdub/venv/local/lib/python2.7/site-packages/rest_framework/serializers.py", line 351, in to_native
    value = field.field_to_native(obj, field_name)
  File "/home/ubuntu/dubdubdub/venv/local/lib/python2.7/site-packages/rest_framework/serializers.py", line 410, in field_to_native
    return [self.to_native(item) for item in value.all()]
  File "/home/ubuntu/dubdubdub/venv/local/lib/python2.7/site-packages/rest_framework/serializers.py", line 351, in to_native
    value = field.field_to_native(obj, field_name)
  File "/home/ubuntu/dubdubdub/venv/local/lib/python2.7/site-packages/rest_framework/fields.py", line 1035, in field_to_native
    value = getattr(self.parent, self.method_name)(obj)
  File "/home/ubuntu/dubdubdub/apps/schools/serializers.py", line 611, in get_singlescore_details
    assessment=obj.assessment).values('singlescore', 'percentile', 'gradesinglescore', 'boundary__name', 'boundary')[0]
  File "/home/ubuntu/dubdubdub/venv/local/lib/python2.7/site-packages/django/db/models/query.py", line 177, in __getitem__
    return list(qs)[0]
IndexError: list index out of range

@prajdataspect
Copy link
Collaborator

Do we have any test values for this?

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

No branches or pull requests

2 participants