From 37dcd553705421201f00fb7f6a75a6214afb9d60 Mon Sep 17 00:00:00 2001 From: Francisco Couzo Date: Fri, 4 Oct 2019 17:50:19 -0300 Subject: [PATCH] Fix bug in escape_curly_brackets (#6909) --- rest_framework/routers.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) 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):