ninuxorg/nodeshot — Issue #59: MultiValueDictKeyError on interface edit
Author: cl4u2
Created: 2012-01-11 14:35:45+00:00
State: open
Labels: Bug

I had a problem editing a node and inserting an interface's details. Before the following trace, I modified an interface's details, I added a new interface, canceled because I didn't want to add it and then saved.

--
Environment:

Request Method: POST
Request URL: http://map.ninux.org/node/edit/interface/6766/sha1$1hinI7jSiCC2$07f32fc9df3ca86485621bc7412a5ca0e79760a9/

Django Version: 1.4 pre-alpha SVN-16920
Python Version: 2.7.2
Installed Applications:
['django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.admin',
'nodeshot']
Installed Middleware:
('django.middleware.common.CommonMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'staticgenerator.middleware.StaticGeneratorMiddleware')

Traceback:
File "/home/ninux/nodeshot/venv/lib/python2.7/site-packages/django/core/handlers/base.py" in get_response
111. response = callback(request, *callback_args, **callback_kwargs)
File "/home/ninux/nodeshot/nodeshot/views.py" in configuration
767. formset = modelFormSet(request.POST, instance=device, prefix='%s%s'%(type,i))
File "/home/ninux/nodeshot/venv/lib/python2.7/site-packages/django/forms/models.py" in __init__
689. queryset=qs)
File "/home/ninux/nodeshot/venv/lib/python2.7/site-packages/django/forms/models.py" in __init__
422. super(BaseModelFormSet, self).__init__(**defaults)
File "/home/ninux/nodeshot/venv/lib/python2.7/site-packages/django/forms/formsets.py" in __init__
47. self._construct_forms()
File "/home/ninux/nodeshot/venv/lib/python2.7/site-packages/django/forms/formsets.py" in _construct_forms
112. self.forms.append(self._construct_form(i))
File "/home/ninux/nodeshot/venv/lib/python2.7/site-packages/django/forms/models.py" in _construct_form
698. form = super(BaseInlineFormSet, self)._construct_form(i, **kwargs)
File "/home/ninux/nodeshot/venv/lib/python2.7/site-packages/django/forms/models.py" in _construct_form
441. pk = self.data[pk_key]
File "/home/ninux/nodeshot/venv/lib/python2.7/site-packages/django/utils/datastructures.py" in __getitem__
258. raise MultiValueDictKeyError("Key %r not found in %r" % (key, self))

Exception Type: MultiValueDictKeyError at /node/edit/interface/6766/sha1$1hinI7jSiCC2$07f32fc9df3ca86485621bc7412a5ca0e79760a9/
Exception Value: "Key 'interface2-0-id' not found in "