Skip to content
Browse files

Limit results to published pages

Use the public() method of PageManager to filter published pages rather than direct attribute access.
  • Loading branch information
acspike committed May 12, 2014
1 parent 67e97ad commit 307efd70e662726acbc55084e89b965ad29c854f
Showing with 2 additions and 3 deletions.
  1. +2 −3 cmsplugin_htmlsitemap/
@@ -18,10 +18,9 @@ class HtmlSitemapPlugin(CMSPluginBase):

def render(self, context, instance, placeholder):
site = Site.objects.get_current()
pages = Page.objects.published(site=site).order_by('tree_id', 'lft')
pages = Page.objects.public().published(site=site).order_by('tree_id', 'lft')
pages = pages.filter(level__gte=instance.level_min,
if not instance.in_navigation is None:
pages = pages.filter(in_navigation=instance.in_navigation)
if instance.match_language:

0 comments on commit 307efd7

Please sign in to comment.
You can’t perform that action at this time.