Commit 0f24974b by Arjun Singh

Stripping off trailing slashes rather than hacking them into the regex

parent b66a4448
......@@ -19,7 +19,7 @@ URL_RE = re.compile("""
(?P<org>[^/]+)/
(?P<course>[^/]+)/
(?P<category>[^/]+)/
(?P<name>[^@/]+)
(?P<name>[^@]+)
(@(?P<revision>[^/]+))?
""", re.VERBOSE)
......@@ -138,6 +138,8 @@ class Location(_LocationBase):
check(list_[4], INVALID_CHARS_NAME)
if isinstance(location, basestring):
if location.endswith('/'):
location = location[:-1]
match = URL_RE.match(location)
if match is None:
log.debug('location is instance of %s but no URL match' % basestring)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment