Skip to content

Commit

Permalink
Merge pull request #4 from acspike/master
Browse files Browse the repository at this point in the history
Limit results to published pages
  • Loading branch information
Raphael Jasjukaitis committed May 13, 2014
2 parents 67e97ad + 307efd7 commit 4304fb7
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 4304fb7

Please sign in to comment.