[wiki/categorie_public] Strip final / then infering page name from url

This commit is contained in:
Valentin Samir 2013-10-29 20:05:22 +01:00
parent 614452a323
commit e4541a6340

View file

@ -38,7 +38,10 @@ class PublicCategories(AnonymousAuth):
sys.stderr.write("Getting page from cache") sys.stderr.write("Getting page from cache")
page = request.page page = request.page
else: else:
page = Page(request, unicode(urllib.unquote(p.path[1:]),'utf-8')) pagename=unicode(urllib.unquote(p.path[1:]),'utf-8')
if pagename.endswith(u'/'):
pagename=pagename[:-1]
page = Page(request, pagename)
acl = page.getACL(request) acl = page.getACL(request)
if acl.acl and [a[0] for a in acl.acl if a[0] == 'All' and a[1].get('read',False)]: if acl.acl and [a[0] for a in acl.acl if a[0] == 'All' and a[1].get('read',False)]:
sys.stderr.write("acl All:read\n") sys.stderr.write("acl All:read\n")