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:
Karl Hobley 2014-10-30 10:02:45 +00:00 committed by Matt Westcott
parent b65adb295d
commit 8266684c37

View file

@ -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,
)