regular expression pattern fix
This fixes reversed `string, pattern` to correct `re.search(pattern, string, flags=0)` format.
This commit is contained in:
parent
f049a4ca67
commit
2fc8f76661
|
@ -163,10 +163,10 @@ class Router:
|
||||||
parameters.append(parameter)
|
parameters.append(parameter)
|
||||||
|
|
||||||
# Mark the whole route as unhashable if it has the hash key in it
|
# 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
|
properties['unhashable'] = True
|
||||||
# Mark the route as unhashable if it matches the hash key
|
# Mark the route as unhashable if it matches the hash key
|
||||||
elif re.search(r'/', pattern):
|
elif re.search(pattern, r'/'):
|
||||||
properties['unhashable'] = True
|
properties['unhashable'] = True
|
||||||
|
|
||||||
return '({})'.format(pattern)
|
return '({})'.format(pattern)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user