diff --git a/wagtail/wagtailforms/templates/wagtailforms/form_index.html b/wagtail/wagtailforms/templates/wagtailforms/form_index.html index 220478067c..1ba23ef196 100644 --- a/wagtail/wagtailforms/templates/wagtailforms/form_index.html +++ b/wagtail/wagtailforms/templates/wagtailforms/form_index.html @@ -58,7 +58,7 @@
{% if submissions %} {% include "wagtailforms/list.html" %} - {% url "wagtailforms_list_submissions" form_page.content_type.app_label form_page.content_type.model form_page.id as linkurl %} + {% url "wagtailforms_list_submissions" form_page.id as linkurl %} {% include "wagtailadmin/shared/pagination_nav.html" with items=submissions is_searching=False %} {% else %}

{% blocktrans with title=form_page.title %}No submissions of the '{{ title }}' form.{% endblocktrans %}

diff --git a/wagtail/wagtailforms/templates/wagtailforms/index.html b/wagtail/wagtailforms/templates/wagtailforms/index.html index d99fc8d982..bb813ebe0b 100644 --- a/wagtail/wagtailforms/templates/wagtailforms/index.html +++ b/wagtail/wagtailforms/templates/wagtailforms/index.html @@ -12,7 +12,7 @@ {% for fp in form_pages %}
  • - + {{ fp|capfirst }} diff --git a/wagtail/wagtailforms/urls.py b/wagtail/wagtailforms/urls.py index afcaaa5a6f..e3f6bf6a89 100644 --- a/wagtail/wagtailforms/urls.py +++ b/wagtail/wagtailforms/urls.py @@ -4,6 +4,6 @@ from django.conf.urls import patterns, url urlpatterns = patterns( 'wagtail.wagtailforms.views', url(r'^$', 'index', name='wagtailforms_index'), - url(r'^submissions/(\w+)/(\w+)/(\d+)/$', 'list_submissions', name='wagtailforms_list_submissions'), + url(r'^submissions/(\d+)/$', 'list_submissions', name='wagtailforms_list_submissions'), ) diff --git a/wagtail/wagtailforms/views.py b/wagtail/wagtailforms/views.py index b854839952..8f54005170 100644 --- a/wagtail/wagtailforms/views.py +++ b/wagtail/wagtailforms/views.py @@ -3,34 +3,15 @@ import json import unicodecsv from django.core.paginator import Paginator, EmptyPage, PageNotAnInteger -from django.http import Http404, HttpResponse -from django.shortcuts import get_object_or_404, render, redirect -from django.utils.text import capfirst -from django.contrib.contenttypes.models import ContentType +from django.http import HttpResponse +from django.shortcuts import get_object_or_404, render from django.contrib.auth.decorators import permission_required -from django.core.exceptions import PermissionDenied -from django.utils.translation import ugettext as _ from wagtail.wagtailcore.models import Page from wagtail.wagtailforms.models import FormSubmission, get_form_types from wagtail.wagtailforms.forms import SelectDateForm -def get_form_type_from_url_params(app_name, model_name): - """ - Retrieve a form type from an app_name / model_name combo. - Throw Http404 if not a valid form type - """ - try: - content_type = ContentType.objects.get_by_natural_key(app_name, model_name) - except ContentType.DoesNotExist: - raise Http404 - if content_type not in get_form_types(): - raise Http404 - - return content_type - - @permission_required('wagtailadmin.access_admin') def index(request): form_types = get_form_types() @@ -42,7 +23,7 @@ def index(request): @permission_required('wagtailadmin.access_admin') -def list_submissions(request, app_label, model, page_id): +def list_submissions(request, page_id): form_page = get_object_or_404(Page, id=page_id) submissions = FormSubmission.objects.filter(page=form_page)