diff --git a/wagtail/wagtailforms/edit_handlers.py b/wagtail/wagtailforms/edit_handlers.py index fcd0de8dab..93c61531d7 100644 --- a/wagtail/wagtailforms/edit_handlers.py +++ b/wagtail/wagtailforms/edit_handlers.py @@ -13,13 +13,15 @@ class BaseFormSubmissionsPanel(EditHandler): def render(self): from .models import FormSubmission submissions = FormSubmission.objects.filter(page=self.instance) + submission_count = submissions.count() - if not submissions: + if not submission_count: return '' return mark_safe(render_to_string(self.template, { 'self': self, - 'submissions': submissions + 'submission_count': submission_count, + 'last_submit_time': submissions.order_by('submit_time').last().submit_time, })) diff --git a/wagtail/wagtailforms/templates/wagtailforms/edit_handlers/form_responses_panel.html b/wagtail/wagtailforms/templates/wagtailforms/edit_handlers/form_responses_panel.html index 340e4beef5..b8774cb40f 100644 --- a/wagtail/wagtailforms/templates/wagtailforms/edit_handlers/form_responses_panel.html +++ b/wagtail/wagtailforms/templates/wagtailforms/edit_handlers/form_responses_panel.html @@ -9,7 +9,7 @@
- {{ submissions.count }} + {{ submission_count }}
@@ -19,7 +19,7 @@

- {{ submissions.last.submit_time }} + {{ last_submit_time }}