strip leading underscores in cname

This commit is contained in:
Matthew Scragg 2015-12-08 17:16:33 -06:00
parent e3508e365f
commit d24d8720db

View file

@ -94,6 +94,7 @@ def to_canonical(s):
s = s.encode('utf8')
s = str(s)
s = s.strip()
s = s.lstrip('_')
s = re.sub(r"\s", "-", s)
s = re.sub(r"[" + re.escape(reserved_chars) + "]", "", s)
s = re.sub(r"[" + re.escape(unsafe_chars) + "]", "", s)