MultiValueDictKeyError: "'body-0-deleted'"
See original GitHub issueWe keep getting this issue:
MultiValueDictKeyError: "'body-0-deleted'"
File "django/core/handlers/base.py", line 111, in get_response
response = wrapped_callback(request, *callback_args, **callback_kwargs)
File "django/views/decorators/cache.py", line 38, in _cache_controlled
response = viewfunc(request, *args, **kw)
File "django/contrib/auth/decorators.py", line 21, in _wrapped_view
return view_func(request, *args, **kwargs)
File "wagtail/wagtailadmin/views/pages.py", line 150, in create
validate_page_form(form, parent_page)
File "wagtail/wagtailadmin/views/pages.py", line 311, in validate_page_form
form.full_clean()
File "django/forms/forms.py", line 353, in full_clean
self._clean_fields()
File "django/forms/forms.py", line 362, in _clean_fields
value = field.widget.value_from_datadict(self.data, self.files, self.add_prefix(name))
File "wagtail/wagtailcore/blocks/base.py", line 457, in value_from_datadict
return self.block_def.value_from_datadict(data, files, name)
File "wagtail/wagtailcore/blocks/stream_block.py", line 138, in value_from_datadict
if data['%s-%d-deleted' % (prefix, i)]:
File "django/utils/datastructures.py", line 319, in __getitem__
raise MultiValueDictKeyError(repr(key))
Here is the body:
{
action-submit: Submit for moderation,
author: The Late Show,
body-count: 1,
cover_image: 21679,
csrfmiddlewaretoken: 5h4B0Z7TacaIIPPQDs1LyNuJlJp3o3Iq,
expire_at: ,
go_live_at: ,
page_relations-INITIAL_FORMS: 0,
page_relations-MAX_NUM_FORMS: 1000,
page_relations-MIN_NUM_FORMS: 0,
page_relations-TOTAL_FORMS: 0,
search_description: ,
seo_title: ,
slug: dislike-or-not-dislike,
summary: <p>The rumors are true, Facebook is creating a "Dislike" button.</p>,
tags: Kriya,Gangiah,FrankieDuToit,TheLateShow,facebook,dislike,
title: To "Dislike" or not to "Dislike"
}
It seems to be related to this:
http://stackoverflow.com/questions/5895588/django-multivaluedictkeyerror-error-how-do-i-deal-with-it
Issue Analytics
- State:
- Created 8 years ago
- Comments:12 (4 by maintainers)
Top Results From Across the Web
django MultiValueDictKeyError error, how do I deal with it
I'm trying to save a object to my database, but it's throwing a MultiValueDictKeyError error.
Read more >MultiValueDictKeyError at /cms/pages/15/edit/ "'row-0-body ...
Resolution: Workaround > Wagtail: MultiValueDictKeyError at ... '1' > row-0-DELETE = '' > row-1-body-count = '1' > row-1-body-0-deleted ...
Read more >How to solve MultiValueDictKeyError - Google Groups
Hello friends, I don't know why Django is so unstable. Before restarting my computer everything works fine. Django could parse a simple
Read more >MultiValueDictKeyError at /products/create/ : r/django - Reddit
after clicking on upload button i'm getting multivaluedictkeyerror : here'is my whole error : MultiValueDictKeyError at /products/create…
Read more >MultiValueDictKeyError at /n - YouTube
MultiValueDictKeyError at /n error solved in DjangoConnect me with Blog-www.javaatpoint.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
OK - I think this is caused by the editor using the ‘back’ button while editing. I’ve been able to reproduce it with the following steps (in Chrome):
I don’t think it’s possible to eliminate this entirely - the browser is trying to restore the previous state of the form (including the hidden field that specifies how many blocks there are in the streamfield), but fails because the form HTML changes dynamically during editing. However, this will be mitigated by #475, which discourages users from casually browsing away from the page editor - therefore I’ll close this as a duplicate of #475.
We’ve recently had this occur when sharing preview links, hopefully recreatable with #7392.