Skip to content

Commit

Permalink
Limit results to published pages
Browse files Browse the repository at this point in the history
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 307efd7
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions cmsplugin_htmlsitemap/cms_plugins.py
Expand Up @@ -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,
level__lte=instance.level_max,
publisher_is_draft=False)
level__lte=instance.level_max)
if not instance.in_navigation is None:
pages = pages.filter(in_navigation=instance.in_navigation)
if instance.match_language:
Expand Down

0 comments on commit 307efd7

Please sign in to comment.