summaryrefslogtreecommitdiff
path: root/django/urls
diff options
context:
space:
mode:
authorCarlton Gibson <carlton.gibson@noumenal.es>2020-10-20 09:14:48 +0200
committerCarlton Gibson <carlton@noumenal.es>2020-10-22 14:15:19 +0200
commitad11f5b8c9cbfdb763e08c83170694abc0c5fc1e (patch)
tree28647127cf0bc05120bee7417609ec997a5b1f96 /django/urls
parent34180922380cf41cd684f846ecf00f92eb289bcf (diff)
Fixed #32124 -- Added per-view opt-out for APPEND_SLASH behavior.
Diffstat (limited to 'django/urls')
-rw-r--r--django/urls/base.py9
1 files changed, 4 insertions, 5 deletions
diff --git a/django/urls/base.py b/django/urls/base.py
index 3899feeefb..6cf75d3a3f 100644
--- a/django/urls/base.py
+++ b/django/urls/base.py
@@ -145,13 +145,12 @@ def get_urlconf(default=None):
def is_valid_path(path, urlconf=None):
"""
- Return True if the given path resolves against the default URL resolver,
- False otherwise. This is a convenience method to make working with "is
- this a match?" cases easier, avoiding try...except blocks.
+ Return the ResolverMatch if the given path resolves against the default URL
+ resolver, False otherwise. This is a convenience method to make working
+ with "is this a match?" cases easier, avoiding try...except blocks.
"""
try:
- resolve(path, urlconf)
- return True
+ return resolve(path, urlconf)
except Resolver404:
return False