ephios-dev / ephios

ephios is a django web application for managing participation for services at events, like paramedics at a festival, lifeguards at the beach, referees and judges at competitions, etc.

Home Page:https://ephios.de

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Switching from signup method with requested state to one w/o breaks disposition

jeriox opened this issue · comments


2021-12-03 14:39:00,166 DEBG 'uwsgi' stderr output:
Traceback (most recent call last):
  File "/home/juhsp/.local/lib/python3.8/site-packages/django/core/handlers/exception.py", line 47, in inner

2021-12-03 14:39:00,167 DEBG 'uwsgi' stderr output:
    response = get_response(request)
  File "/home/juhsp/.local/lib/python3.8/site-packages/django/core/handlers/base.py", line 181, in _get_response

2021-12-03 14:39:00,168 DEBG 'uwsgi' stderr output:
    response = wrapped_callback(request, *callback_args, **callback_kwargs)
  File "/home/juhsp/.local/lib/python3.8/site-packages/django/views/generic/base.py", line 70, in view

2021-12-03 14:39:00,168 DEBG 'uwsgi' stderr output:
    return self.dispatch(request, *args, **kwargs)
  File "/home/juhsp/.local/lib/python3.8/site-packages/ephios/core/signup/disposition.py", line 118, in dispatch

2021-12-03 14:39:00,169 DEBG 'uwsgi' stderr output:
    return super().dispatch(request, *args, **kwargs)
  File "/home/juhsp/.local/lib/python3.8/site-packages/django/contrib/auth/mixins.py", line 104, in dispatch

2021-12-03 14:39:00,169 DEBG 'uwsgi' stderr output:
    return super().dispatch(request, *args, **kwargs)
  File "/home/juhsp/.local/lib/python3.8/site-packages/django/views/generic/base.py", line 98, in dispatch
    return handler(request, *args, **kwargs)
  File "/home/juhsp/.local/lib/python3.8/site-packages/ephios/core/signup/disposition.py", line 224, in post

2021-12-03 14:39:00,170 DEBG 'uwsgi' stderr output:
    if not formset.is_valid():
  File "/home/juhsp/.local/lib/python3.8/site-packages/django/forms/formsets.py", line 321, in is_valid

2021-12-03 14:39:00,171 DEBG 'uwsgi' stderr output:
    self.errors
  File "/home/juhsp/.local/lib/python3.8/site-packages/django/forms/formsets.py", line 304, in errors

2021-12-03 14:39:00,171 DEBG 'uwsgi' stderr output:
    self.full_clean()
  File "/home/juhsp/.local/lib/python3.8/site-packages/django/forms/formsets.py", line 355, in full_clean

2021-12-03 14:39:00,172 DEBG 'uwsgi' stderr output:
    for i, form in enumerate(self.forms):
  File "/home/juhsp/.local/lib/python3.8/site-packages/django/utils/functional.py", line 48, in __get__

2021-12-03 14:39:00,172 DEBG 'uwsgi' stderr output:
    res = instance.__dict__[self.name] = self.func(instance)
  File "/home/juhsp/.local/lib/python3.8/site-packages/django/forms/formsets.py", line 155, in forms
    return [
  File "/home/juhsp/.local/lib/python3.8/site-packages/django/forms/formsets.py", line 156, in <listcomp>

2021-12-03 14:39:00,175 DEBG 'uwsgi' stderr output:
    self._construct_form(i, **self.get_form_kwargs(i))
  File "/home/juhsp/.local/lib/python3.8/site-packages/django/forms/models.py", line 632, in _construct_form
    form = super()._construct_form(i, **kwargs)
  File "/home/juhsp/.local/lib/python3.8/site-packages/django/forms/formsets.py", line 193, in _construct_form
    form = self.form(**defaults)
  File "/home/juhsp/.local/lib/python3.8/site-packages/ephios/core/signup/disposition.py", line 31, in __init__
    super().__init__(**kwargs)
  File "/home/juhsp/.local/lib/python3.8/site-packages/ephios/core/signup/methods.py", line 141, in __init__
    instance = kwargs["instance"]
KeyError: 'instance'

A requested participation had been created for the affected shift. It was later changed to use a signup-method that is not using the requested state. Hence the disposition queryset wasn't rendering the requested participation to the template, so the pk was missing in the post data, which lead to a key error when dealing with the POST data.