fix dynamic route can't match url rightly

This commit is contained in:
Chris Guo 2019-08-13 21:55:08 +08:00
parent 5a8736ae45
commit c6798d63ba

View File

@ -38,8 +38,12 @@ def escape_curly_brackets(url_path):
""" """
Double brackets in regex of url_path for escape string formatting Double brackets in regex of url_path for escape string formatting
""" """
if ('{' and '}') in url_path: if '{' in url_path:
url_path = url_path.replace('{', '{{').replace('}', '}}') url_path = url_path.replace('{', '{{')
if '}' in url_path:
url_path = url_path.replace('}', '}}')
return url_path return url_path