Signalen / backend

Backend for Signalen, an application that helps cities manage and prioritize nuisance reports.
https://signalen.org
Mozilla Public License 2.0
5 stars 5 forks source link

Error 500 while retrieving public map endpoint with browser #126

Closed bartjkdp closed 3 years ago

bartjkdp commented 3 years ago

This error occurs when pasting the full request URL in the browser. Works with XHR request.

GET /signals/v1/public/map-signals/?page=1&ordering=-created_at&page_size=4

2021-02-25 21:52:03,975 - django.request - ERROR - Internal Server Error: /signals/v1/public/map-signals/
Traceback (most recent call last):
File "/usr/local/lib/python3.8/site-packages/django/core/handlers/exception.py", line 34, in inner
response = get_response(request)
File "/usr/local/lib/python3.8/site-packages/django/core/handlers/base.py", line 145, in _get_response
response = self.process_exception_by_middleware(e, request)
File "/usr/local/lib/python3.8/site-packages/django/core/handlers/base.py", line 143, in _get_response
response = response.render()
File "/usr/local/lib/python3.8/site-packages/django/template/response.py", line 106, in render
self.content = self.rendered_content
File "/usr/local/lib/python3.8/site-packages/rest_framework/response.py", line 70, in rendered_content
ret = renderer.render(self.data, accepted_media_type, context)
File "/usr/local/lib/python3.8/site-packages/rest_framework/renderers.py", line 724, in render
context = self.get_context(data, accepted_media_type, renderer_context)
File "/usr/local/lib/python3.8/site-packages/rest_framework/renderers.py", line 655, in get_context
raw_data_post_form = self.get_raw_data_form(data, view, 'POST', request)
File "/usr/local/lib/python3.8/site-packages/rest_framework/renderers.py", line 554, in get_raw_data_form
serializer = view.get_serializer()
File "/usr/local/lib/python3.8/site-packages/rest_framework/generics.py", line 108, in get_serializer
serializer_class = self.get_serializer_class()
File "/usr/local/lib/python3.8/site-packages/rest_framework/generics.py", line 122, in get_serializer_class
assert self.serializer_class is not None, (
AssertionError: 'PublicSignalListViewSet' should either include a `serializer_class` attribute, or override the `get_serializer_class()` method.
CBuiVNG commented 3 years ago

Pagination isn't supported for now. We only return max 4000 items. But it should not bail out like this.

CBuiVNG commented 3 years ago

https://github.com/Amsterdam/signals/pull/741