diff --git a/rest_framework/routers.py b/rest_framework/routers.py index ee5760e81..d8e19a2d7 100644 --- a/rest_framework/routers.py +++ b/rest_framework/routers.py @@ -38,9 +38,7 @@ def escape_curly_brackets(url_path): """ Double brackets in regex of url_path for escape string formatting """ - if ('{' and '}') in url_path: - url_path = url_path.replace('{', '{{').replace('}', '}}') - return url_path + return url_path.replace('{', '{{').replace('}', '}}') def flatten(list_of_lists):