mirror of
https://github.com/Hopiu/wagtail.git
synced 2026-05-20 21:11:55 +00:00
Use form.cleaned_data when processing submissions
This fixes #584. It also doesn't pack single values into lists and will remove csrftoken for us.
This commit is contained in:
parent
b65adb295d
commit
8266684c37
1 changed files with 1 additions and 7 deletions
|
|
@ -131,14 +131,8 @@ class AbstractForm(Page):
|
|||
return {}
|
||||
|
||||
def process_form_submission(self, form):
|
||||
# remove csrf_token from form.data
|
||||
form_data = dict(
|
||||
i for i in form.data.items()
|
||||
if i[0] != 'csrfmiddlewaretoken'
|
||||
)
|
||||
|
||||
FormSubmission.objects.create(
|
||||
form_data=json.dumps(form_data),
|
||||
form_data=json.dumps(form.cleaned_data),
|
||||
page=self,
|
||||
)
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue