OpenSlides / openslides-backend

Backend service for OpenSlides 4+
MIT License
6 stars 26 forks source link

Fix `KeyError` in `get_forwarding_meetings` presenter #2003

Closed jsangmeister closed 11 months ago

jsangmeister commented 12 months ago

This traceback occured and should be fixed:

Traceback (most recent call last):
  File "/usr/local/lib/python3.10/site-packages/gunicorn/workers/gthread.py", line 282, in handle
    keepalive = self.handle_request(req, conn)
  File "/usr/local/lib/python3.10/site-packages/gunicorn/workers/gthread.py", line 334, in handle_request
    respiter = self.wsgi(environ, resp.start_response)
  File "/app/openslides_backend/http/application.py", line 103, in __call__
    return self.wsgi_application(environ, start_response)
  File "/app/openslides_backend/http/application.py", line 93, in wsgi_application
    response = self.dispatch_request(request)
  File "/app/openslides_backend/http/application.py", line 44, in dispatch_request
    response_body, access_token = view_instance.dispatch(request)
  File "/app/openslides_backend/http/views/base_view.py", line 117, in dispatch
    return func(request)
  File "/app/openslides_backend/http/views/presenter_view.py", line 30, in presenter_route
    presenter_response, access_token = handler.handle_request(request)
  File "/app/openslides_backend/presenter/presenter.py", line 77, in handle_request
    response, access_token = self.parse_presenters(request)
  File "/app/openslides_backend/presenter/presenter.py", line 134, in parse_presenters
    result = presenter_instance.get_result()
  File "/app/openslides_backend/presenter/get_forwarding_meetings.py", line 40, in get_result
    self.data["meeting_id"],
KeyError: 'meeting_id'
luisa-beerboom commented 11 months ago

Seems someone sent an empty payload, we should probably look to see if there is a bug in the client that may do this, for now, I've ensured with a PR that the schema validator knows the meeting_id field to be required

luisa-beerboom commented 11 months ago

I suppose I'll be creating an investigation issue for this and #2009 in the client repo

luisa-beerboom commented 11 months ago

=> Openslides/openslides-client#3067