From 1033897146672d93dec7d35db81db558c51dc42f Mon Sep 17 00:00:00 2001 From: Matt Westcott Date: Tue, 27 Oct 2015 00:42:21 +0000 Subject: [PATCH] Add site column to redirects listing (and show redirects from all sites, not just current one) --- .../templates/wagtailredirects/list.html | 9 +++++++-- wagtail/wagtailredirects/views.py | 2 +- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/wagtail/wagtailredirects/templates/wagtailredirects/list.html b/wagtail/wagtailredirects/templates/wagtailredirects/list.html index 3621b9a346..154df9055a 100644 --- a/wagtail/wagtailredirects/templates/wagtailredirects/list.html +++ b/wagtail/wagtailredirects/templates/wagtailredirects/list.html @@ -1,7 +1,8 @@ {% load i18n %} - - + + + @@ -14,6 +15,7 @@ {% trans "From" %} {% endif %} + @@ -24,6 +26,9 @@ +
{% trans "Site" %} {% trans "To" %} {% trans "Type" %}

{{ redirect.title }}

+ {% if redirect.site %}{{ redirect.site }}{% endif %} + {% if redirect.redirect_page %} {{ redirect.redirect_page.title }} diff --git a/wagtail/wagtailredirects/views.py b/wagtail/wagtailredirects/views.py index 4bcb483966..bde75f9d26 100644 --- a/wagtail/wagtailredirects/views.py +++ b/wagtail/wagtailredirects/views.py @@ -18,7 +18,7 @@ def index(request): query_string = request.GET.get('q', "") ordering = request.GET.get('ordering', 'old_path') - redirects = models.Redirect.get_for_site(site=request.site).prefetch_related('redirect_page') + redirects = models.Redirect.objects.prefetch_related('redirect_page', 'site') # Search if query_string: