-
-
Notifications
You must be signed in to change notification settings - Fork 136
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
Exception Type: KeyError at ... #247
Comments
i have the same problem. Everything was fine on Django 4.2.3 |
We recently had similar issue and it was even using the wrong form for some step. |
Traceback: Traceback (most recent call last):
File "/opt/venvs/[...]/lib/python3.8/site-packages/django/core/handlers/exception.py", line 55, in inner
response = get_response(request)
File "/opt/venvs/[...]/lib/python3.8/site-packages/django/core/handlers/base.py", line 197, in _get_response
response = wrapped_callback(request, *callback_args, **callback_kwargs)
File "/opt/venvs/[...]/lib/python3.8/site-packages/django/views/generic/base.py", line 104, in view
return self.dispatch(request, *args, **kwargs)
File "/opt/venvs/[...]/lib/python3.8/site-packages/formtools/wizard/views.py", line 250, in dispatch
response = super().dispatch(request, *args, **kwargs)
File "/opt/venvs/[...]/lib/python3.8/site-packages/django/views/generic/base.py", line 143, in dispatch
return handler(request, *args, **kwargs)
File "/opt/venvs/[...]/lib/python3.8/site-packages/formtools/wizard/views.py", line 297, in post
form = self.get_form(data=self.request.POST, files=self.request.FILES)
File "/opt/venvs/[...]/lib/python3.8/site-packages/formtools/wizard/views.py", line 415, in get_form
form_class = self.get_form_list()[step]
Exception Type: KeyError at [...]
Exception Value: 'company'
POST:
service_request_wizard_view-current_step = 'company' any clues? |
we only noticed the function we used in the condition_dict had the wizard passed to it with different steps under one request, which showed wizard.steps.current had different value even though it was the same step (probably checked the next step too somewhere so it passed to it with next step too, which evaulated as false then true right again) Another side effect we saw it used the wrong form because of this, like used the form of the skipped step instead of the one for the step I assume you have a condition_dict (because that's usually how the get_form_list() can have missing step) I tried to wrap my head around the code, but i couldn't get much of it, so if it's not there, i dont have an idea right now |
I get random KeyErrors from time to time. Any clues what its may be?
The text was updated successfully, but these errors were encountered: