Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

exclude pages with redirects from being indexed #11

Merged
merged 1 commit into from

2 participants

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Mar 28, 2012
  1. @stefanfoulis
This page is out of date. Refresh to see the latest.
Showing with 3 additions and 1 deletion.
  1. +3 −1 cms_search/search_indexes.py
View
4 cms_search/search_indexes.py
@@ -84,7 +84,9 @@ def prepare(self, obj):
activate(current_languge)
def index_queryset(self):
- qs = proxy_model.objects.published().filter(title_set__language=language_code).distinct()
+ # get the correct language and exclude pages that have a redirect
+ qs = proxy_model.objects.published().filter(
+ title_set__language=language_code, title_set__redirect__isnull=True).distinct()
if 'publisher' in settings.INSTALLED_APPS:
qs = qs.filter(publisher_is_draft=True)
return qs
Something went wrong with that request. Please try again.