From d24d8720db4c4b94efdecf1b55112335e556e4e5 Mon Sep 17 00:00:00 2001 From: Matthew Scragg Date: Tue, 8 Dec 2015 17:16:33 -0600 Subject: [PATCH] strip leading underscores in cname --- realms/lib/util.py | 1 + 1 file changed, 1 insertion(+) diff --git a/realms/lib/util.py b/realms/lib/util.py index 2acb402..fdb7777 100644 --- a/realms/lib/util.py +++ b/realms/lib/util.py @@ -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)