Kaydet (Commit) f0ffa3f4 authored tarafından Jon Dufresne's avatar Jon Dufresne Kaydeden (comit) Tim Graham

Refs #27025, #28593 -- Fixed "invalid escape sequence" warnings in urls/resolvers.py.

üst 41406bf9
......@@ -119,7 +119,7 @@ class CheckURLMixin:
# Skip check as it can be useful to start a URL pattern with a slash
# when APPEND_SLASH=False.
return []
if regex_pattern.startswith(('/', '^/', '^\/')) and not regex_pattern.endswith('/'):
if regex_pattern.startswith(('/', '^/', '^\\/')) and not regex_pattern.endswith('/'):
warning = Warning(
"Your URL pattern {} has a route beginning with a '/'. Remove this "
"slash as it is unnecessary. If this pattern is targeted in an "
......@@ -187,7 +187,7 @@ class RegexPattern(CheckURLMixin):
_PATH_PARAMETER_COMPONENT_RE = re.compile(
'<(?:(?P<converter>[^>:]+):)?(?P<parameter>\w+)>'
r'<(?:(?P<converter>[^>:]+):)?(?P<parameter>\w+)>'
)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment