bugfix to topbar

This commit is contained in:
Rushabh Mehta
2012-02-06 07:29:52 +01:00
parent 04048ff890
commit af1cb632d6
2 changed files with 6 additions and 5 deletions

View File

@@ -25,7 +25,8 @@ def markdown(doc, fields):
def page_name(title):
"""make page name from title, and check that there is no duplicate"""
import re
name = re.sub('[~!@#$%^&*()<>,."\']', '', title.lower())
name = title.lower()
name = re.sub('[~!@#$%^&*()<>,."\']', '', name)
return '-'.join(name.split()[:4])
def add_page(title):
@@ -50,4 +51,4 @@ def add_guest_access_to_page(page):
d = Document('Page Role')
d.parent = page
d.role = 'Guest'
d.save()
d.save()