Browse Source

[minor] website fixes

version-14
Anand Doshi 11 years ago
parent
commit
24e037e15a
1 changed files with 2 additions and 4 deletions
  1. +2
    -4
      webnotes/webutils.py

+ 2
- 4
webnotes/webutils.py View File

@@ -2,14 +2,12 @@
# MIT License. See license.txt # MIT License. See license.txt


from __future__ import unicode_literals from __future__ import unicode_literals

from webnotes import conf from webnotes import conf
import webnotes import webnotes
import json, os, time import json, os, time
from webnotes import _ from webnotes import _
import webnotes.utils import webnotes.utils
import mimetypes import mimetypes

from website.doctype.website_sitemap.website_sitemap import add_to_sitemap from website.doctype.website_sitemap.website_sitemap import add_to_sitemap


class PageNotFoundError(Exception): pass class PageNotFoundError(Exception): pass
@@ -252,7 +250,7 @@ class WebsiteGenerator(object):
and website_sitemap_config!=%s and docname!=%s""", (new_page_name, and website_sitemap_config!=%s and docname!=%s""", (new_page_name,
self._website_config.name, self.doc.name)): self._website_config.name, self.doc.name)):
webnotes.throw("%s: %s. %s: <b>%s<b>" % (new_page_name, _("Page already exists"), webnotes.throw("%s: %s. %s: <b>%s<b>" % (new_page_name, _("Page already exists"),
_("Please change the value"), title))
_("Please change the value"), self.doc.title))
def on_trash(self): def on_trash(self):
self.setup_generator() self.setup_generator()
@@ -267,7 +265,7 @@ def cleanup_page_name(title):
"""make page name from title""" """make page name from title"""
import re import re
name = title.lower() name = title.lower()
name = re.sub('[~!@#$%^&*+()<>,."\']', '', name)
name = re.sub('[~!@#$%^&*+()<>,."\'\?]', '', name)
name = re.sub('[:/]', '-', name) name = re.sub('[:/]', '-', name)


name = '-'.join(name.split()) name = '-'.join(name.split())


Loading…
Cancel
Save