Permalink
Browse files

Merge pull request #11 from stefanfoulis/patch-1

exclude pages with redirects from being indexed
  • Loading branch information...
2 parents 8fb1ea0 + 7eb03ee commit b5c52cc4c17e0f8cc0004bb417265e1cc7cccb9b @piquadrat committed Mar 28, 2012
Showing with 3 additions and 1 deletion.
  1. +3 −1 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

0 comments on commit b5c52cc

Please sign in to comment.