regular expression pattern fix

This fixes reversed `string, pattern` to correct `re.search(pattern, string, flags=0)` format.
This commit is contained in:
Jeremy Zimmerman 2017-06-22 14:34:54 -07:00 committed by GitHub
parent f049a4ca67
commit 2fc8f76661

View File

@ -163,10 +163,10 @@ class Router:
parameters.append(parameter)
# Mark the whole route as unhashable if it has the hash key in it
if re.search(r'(^|[^^]){1}/', pattern):
if re.search(pattern, r'(^|[^^]){1}/'):
properties['unhashable'] = True
# Mark the route as unhashable if it matches the hash key
elif re.search(r'/', pattern):
elif re.search(pattern, r'/'):
properties['unhashable'] = True
return '({})'.format(pattern)