Am 2012-05-08 um 08:41 schrieb Matthias Kestenholz:
> - The form is submitted before the page is completely loaded which
> leads to missing fields
> - (Especially) Firefox does try harder to preserve the entered form
> data when reloading the page after an error happened. Sometimes you
> have to navigate somewhere else and back to the item editor so that it
> works again.
>
> I'd start having a look at the POSTed data and at the specific inline
> formset which raises this error upon instantiation. Is it really the
> rich text content formset, or might it be something else?
Ok, after a break I tried to finally nail this.
I moved the site to Python 2.7, latest release version of all modules
(except gunicorn, due to problems with 0.14), but still get the
ManagementForm data error (traceback see below) on every save of a
page in admin.
It’s not (only) the RichTextContent, but I can’t even add an empty new
page.
Here is my POST data:
POST:<QueryDict: {
u'_continue': [u'Sichern und weiter bearbeiten'],
u'active': [u'on'],
u'contactformcontent_set-__prefix__-email': [u''],
u'contactformcontent_set-__prefix__-id': [u''],
u'contactformcontent_set-__prefix__-ordering': [u''],
u'contactformcontent_set-__prefix__-parent': [u''],
u'contactformcontent_set-__prefix__-region': [u''],
u'contactformcontent_set-__prefix__-subject': [u''],
u'contactformcontent_set-INITIAL_FORMS': [u'0'],
u'contactformcontent_set-MAX_NUM_FORMS': [u''],
u'contactformcontent_set-TOTAL_FORMS': [u'0'],
u'csrfmiddlewaretoken': [u'79e914b4cd42f614252cee1cbb367xxx'],
u'language': [u'de'],
u'mediafilecontent_set-__prefix__-id': [u''],
u'mediafilecontent_set-__prefix__-mediafile': [u''],
u'mediafilecontent_set-__prefix__-ordering': [u''],
u'mediafilecontent_set-__prefix__-parent': [u''],
u'mediafilecontent_set-__prefix__-position': [u'main'],
u'mediafilecontent_set-__prefix__-region': [u''],
u'mediafilecontent_set-INITIAL_FORMS': [u'0'],
u'mediafilecontent_set-MAX_NUM_FORMS': [u''],
u'mediafilecontent_set-TOTAL_FORMS': [u'0'],
u'order-machine-add-select': [u'richtextcontent', u'richtextcontent'],
u'orderformcontent_set-__prefix__-email': [u''],
u'orderformcontent_set-__prefix__-id': [u''],
u'orderformcontent_set-__prefix__-ordering': [u''],
u'orderformcontent_set-__prefix__-parent': [u''],
u'orderformcontent_set-__prefix__-region': [u''],
u'orderformcontent_set-INITIAL_FORMS': [u'0'],
u'orderformcontent_set-MAX_NUM_FORMS': [u''],
u'orderformcontent_set-TOTAL_FORMS': [u'0'],
u'override_url': [u''],
u'parent': [u'35'],
u'redirect_to': [u''],
u'richtextcontent_set-__prefix__-id': [u''],
u'richtextcontent_set-__prefix__-ordering': [u''],
u'richtextcontent_set-__prefix__-parent': [u''],
u'richtextcontent_set-__prefix__-region': [u''],
u'richtextcontent_set-__prefix__-seen_tidy_warnings': [u''],
u'richtextcontent_set-__prefix__-text': [u''],
u'richtextcontent_set-INITIAL_FORMS': [u'0'],
u'richtextcontent_set-MAX_NUM_FORMS': [u''],
u'richtextcontent_set-TOTAL_FORMS': [u'0'],
u'slug': [u'testbild'],
u'template_key': [u'default'],
u'title': [u'Testbild'],
u'translation_of': [u''],
}>,
Traceback (most recent call last):
File "/var/www/mysite/lib/python2.7/site-packages/django/core/
handlers/base.py", line 111, in get_response
response = callback(request, *callback_args, **callback_kwargs)
File "/var/www/mysite/lib/python2.7/site-packages/django/contrib/
admin/options.py", line 366, in wrapper
return self.admin_site.admin_view(view)(*args, **kwargs)
File "/var/www/mysite/lib/python2.7/site-packages/django/utils/
decorators.py", line 91, in _wrapped_view
response = view_func(request, *args, **kwargs)
File "/var/www/mysite/lib/python2.7/site-packages/django/views/
decorators/cache.py", line 89, in _wrapped_view_func
response = view_func(request, *args, **kwargs)
File "/var/www/mysite/lib/python2.7/site-packages/django/contrib/
admin/sites.py", line 196, in inner
return view(request, *args, **kwargs)
File "/var/www/mysite/lib/python2.7/site-packages/feincms/module/
page/models.py", line 751, in add_view
extra_context=extra_context)
File "/var/www/mysite/lib/python2.7/site-packages/feincms/admin/
item_editor.py", line 217, in add_view
return super(ItemEditor, self).add_view(request, form_url,
extra_context=context)
File "/var/www/mysite/lib/python2.7/site-packages/django/utils/
decorators.py", line 25, in _wrapper
return bound_func(*args, **kwargs)
File "/var/www/mysite/lib/python2.7/site-packages/django/utils/
decorators.py", line 91, in _wrapped_view
response = view_func(request, *args, **kwargs)
File "/var/www/mysite/lib/python2.7/site-packages/django/utils/
decorators.py", line 21, in bound_func
return func(self, *args2, **kwargs2)
File "/var/www/mysite/lib/python2.7/site-packages/django/db/
transaction.py", line 209, in inner
return func(*args, **kwargs)
File "/var/www/mysite/lib/python2.7/site-packages/django/contrib/
admin/options.py", line 952, in add_view
prefix=prefix, queryset=inline.queryset(request))
File "/var/www/mysite/lib/python2.7/site-packages/django/forms/
models.py", line 697, in __init__
queryset=qs, **kwargs)
File "/var/www/mysite/lib/python2.7/site-packages/django/forms/
models.py", line 424, in __init__
super(BaseModelFormSet, self).__init__(**defaults)
File "/var/www/mysite/lib/python2.7/site-packages/django/forms/
formsets.py", line 50, in __init__
self._construct_forms()
File "/var/www/mysite/lib/python2.7/site-packages/django/forms/
formsets.py", line 114, in _construct_forms
for i in xrange(self.total_form_count()):
File "/var/www/mysite/lib/python2.7/site-packages/django/forms/
formsets.py", line 88, in total_form_count
return self.management_form.cleaned_data[TOTAL_FORM_COUNT]
File "/var/www/mysite/lib/python2.7/site-packages/django/forms/
formsets.py", line 75, in _management_form
raise ValidationError('ManagementForm data is missing or has been
tampered with')
ValidationError: [u'ManagementForm data is missing or has been
tampered with']
Do you have any clue where my error comes from?
Greetlings, Hraban
---
http://www.fiee.net
https://www.cacert.org (I'm an assurer)