From 283d282d316c3c63fefd5f8190f662d039c7e1d6 Mon Sep 17 00:00:00 2001 From: cho-leukeleu Date: Tue, 4 Jul 2017 08:23:15 +0200 Subject: [PATCH] Return the created submission instance --- wagtail/wagtailforms/models.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wagtail/wagtailforms/models.py b/wagtail/wagtailforms/models.py index 65c68eb587..a22920bc39 100644 --- a/wagtail/wagtailforms/models.py +++ b/wagtail/wagtailforms/models.py @@ -230,7 +230,7 @@ class AbstractForm(Page): For example, if you want to save reference to a user. """ - self.get_submission_class().objects.create( + return self.get_submission_class().objects.create( form_data=json.dumps(form.cleaned_data, cls=DjangoJSONEncoder), page=self, )