diff options
| author | Tim Graham <timograham@gmail.com> | 2017-03-03 10:52:20 -0500 |
|---|---|---|
| committer | Tim Graham <timograham@gmail.com> | 2017-03-03 10:52:48 -0500 |
| commit | 1f20326db0ff2d5d741d0bc8dc4a8b13c97a3652 (patch) | |
| tree | 4a0fa95fa9ad4ac025ab5eb0774a8c7093d07af1 /django | |
| parent | 93c8e2d50d636e46ded9c6cfed0b0c4623457b74 (diff) | |
[1.11.x] Fixed #27887 -- Fixed URLs check crash with namespaced URLs inside non-namespaced URLs.
Backport of b23d264046db1c8f58a174b9be27ee760341ba06 from master
Diffstat (limited to 'django')
| -rw-r--r-- | django/core/checks/urls.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/django/core/checks/urls.py b/django/core/checks/urls.py index ca21c62409..e1049167fd 100644 --- a/django/core/checks/urls.py +++ b/django/core/checks/urls.py @@ -63,7 +63,10 @@ def _load_all_namespaces(resolver, parents=()): if getattr(url, 'namespace', None) is not None ] for pattern in url_patterns: - current = parents + (getattr(pattern, 'namespace', ()),) + namespace = getattr(pattern, 'namespace', None) + current = parents + if namespace is not None: + current += (namespace,) namespaces.extend(_load_all_namespaces(pattern, current)) return namespaces |
