mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-07-29 01:20:02 +03:00
fix dynamic route can't match url rightly
This commit is contained in:
parent
5a8736ae45
commit
c6798d63ba
|
@ -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
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user