Opened 10 years ago
Closed 10 years ago
#24906 closed Bug (fixed)
ResolverMatch.app_name doesn't contain full application namespace for nested namespaces
| Reported by: | Marten Kenbeek | Owned by: | Marten Kenbeek |
|---|---|---|---|
| Component: | Core (URLs) | Version: | 1.8 |
| Severity: | Normal | Keywords: | |
| Cc: | marten.knbk@… | Triage Stage: | Accepted |
| Has patch: | yes | Needs documentation: | no |
| Needs tests: | no | Patch needs improvement: | no |
| Easy pickings: | no | UI/UX: | no |
Description
ResolverMatch.app_name only contains the outer-most application namespace in the case of nested namespaces. It should contain the full namespace path, separated by :, just like ResolverMatch.namespace.
The documentation[1] is a bit ambiguous in this regard, but I was very much surprised when I found out this behaviour, and in my opinion it's a very obvious bug. The only internal use[2 and 3] would currently be incorrect in the case of nested namespaces. If it should instead follow the backwards compatibility guidelines because of the ambiguity in the docs, please mark it as such.
[1] https://docs.djangoproject.com/en/1.8/ref/urlresolvers/#django.core.urlresolvers.ResolverMatch.app_name
[2] https://github.com/django/django/blob/master/django/contrib/admin/options.py#L897
[3] https://github.com/django/django/blob/master/django/contrib/admin/templatetags/admin_urls.py#L38
Change History (4)
comment:1 by , 10 years ago
| Cc: | added |
|---|---|
| Owner: | changed from to |
| Status: | new → assigned |
comment:2 by , 10 years ago
| Triage Stage: | Unreviewed → Accepted |
|---|
Documenting in the release notes how to update your code for this "bug fix" is likely sufficient.