Skip to content

Commit

Permalink
Merge pull request #1670 from OCHA-DAP/dev
Browse files Browse the repository at this point in the history
Dev in stag
  • Loading branch information
danmihaila committed Nov 4, 2014
2 parents dc43ae3 + bd8d213 commit 619bc23
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions ckanext-sitemap/ckanext/sitemap/controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class SitemapController(BaseController):
def _render_sitemap(self, page):
root = etree.Element("urlset", nsmap={None: SITEMAP_NS})
#pkgs = Session.query(Package).all()
pkgs = Session.query(Package).filter(Package.private == 0).offset(int(page)*25).limit(25)
pkgs = Session.query(Package).filter(Package.private == False).offset(int(page)*25).limit(25)
for pkg in pkgs:
url = etree.SubElement(root, 'url')
loc = etree.SubElement(url, 'loc')
Expand All @@ -40,7 +40,7 @@ def _render_sitemap(self, page):
def view(self):
#Sitemap Index
root = etree.Element("sitemapindex", nsmap={None: SITEMAP_NS})
pkgs = Session.query(Package).count()
pkgs = Session.query(Package).filter(Package.private == False).count()
count = pkgs/25
for i in range(1,count):
sitemap = etree.SubElement(root, 'sitemap')
Expand Down

0 comments on commit 619bc23

Please sign in to comment.