Skip to content
This repository has been archived by the owner on Apr 7, 2020. It is now read-only.

Commit

Permalink
Merge pull request #2 from jedie/hide_login_required
Browse files Browse the repository at this point in the history
Filter pages with 'login_required'
  • Loading branch information
pierreben committed Sep 6, 2016
2 parents 0be7eb5 + 4c51c48 commit c1f262b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion djangocms_htmlsitemap/cms_plugins.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ class HtmlSitemapPlugin(CMSPluginBase):
def render(self, context, instance, placeholder):
site = Site.objects.get_current()
pages = Page.objects.public().published(site=site).order_by('path') \
.filter(depth__gte=instance.min_depth).distinct()
.filter(depth__gte=instance.min_depth, login_required=False) \
.distinct()
if instance.max_depth:
pages = pages.filter(depth__lte=instance.max_depth)
if instance.in_navigation is not None:
Expand Down

0 comments on commit c1f262b

Please sign in to comment.