iiuni / projektzapisy

System Zapisów na zajęcia w Instytucie Informatyki Uniwersytetu Wrocławskiego
https://zapisy.ii.uni.wroc.pl
32 stars 10 forks source link

KeyError: 'grade_poll_tickets' #1640

Open rollbar[bot] opened 9 months ago

rollbar[bot] commented 9 months ago

View details in Rollbar: https://app.rollbar.com/a/iiuni/fix/item/projektzapisy/535

Traceback (most recent call last):
  File "/home/zapisy/deploy/releases/20230828210355/venv/lib/python3.8/site-packages/django/core/handlers/base.py", line 181, in _get_response
    response = wrapped_callback(request, *callback_args, **callback_kwargs)
  File "/home/zapisy/deploy/releases/20230828210355/venv/lib/python3.8/site-packages/newrelic/hooks/framework_django.py", line 554, in wrapper
    return wrapped(*args, **kwargs)
  File "/home/zapisy/deploy/releases/20230828210355/venv/lib/python3.8/site-packages/django/views/generic/base.py", line 70, in view
    return self.dispatch(request, *args, **kwargs)
  File "/home/zapisy/deploy/releases/20230828210355/venv/lib/python3.8/site-packages/newrelic/hooks/framework_django.py", line 944, in wrapper
    return wrapped(*args, **kwargs)
  File "/home/zapisy/deploy/releases/20230828210355/venv/lib/python3.8/site-packages/django/views/generic/base.py", line 98, in dispatch
    return handler(request, *args, **kwargs)
  File "/home/zapisy/deploy/releases/20230828210355/venv/lib/python3.8/site-packages/django/views/generic/edit.py", line 193, in post
    self.object = self.get_object()
  File "/home/zapisy/deploy/releases/20230828210355/zapisy/apps/grade/poll/views.py", line 148, in get_object
    return self.active_submission
  File "/home/zapisy/deploy/releases/20230828210355/zapisy/apps/grade/poll/views.py", line 127, in active_submission
    return self.submissions[self.current_index]
  File "/home/zapisy/deploy/releases/20230828210355/zapisy/apps/grade/poll/views.py", line 137, in submissions
    tickets = self.request.session['grade_poll_tickets']
  File "/home/zapisy/deploy/releases/20230828210355/venv/lib/python3.8/site-packages/django/contrib/sessions/backends/base.py", line 65, in __getitem__
    return self._session[key]
KeyError: 'grade_poll_tickets'
lgpawel commented 9 months ago

Niewykluczone, że błąd jest po stronie użytkownika (skoro w danych sesji nie ma kluczy do głosowania) ale na pewno można to wyłapać i wyświetlić odpowiednie ostrzeżenie/błąd (a najpierw dokładniej zbadać problem)