Opened 9 years ago

Closed 9 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 Marten Kenbeek, 9 years ago

Cc: marten.knbk@… added
Owner: changed from nobody to Marten Kenbeek
Status: newassigned

comment:2 by Tim Graham, 9 years ago

Triage Stage: UnreviewedAccepted

Documenting in the release notes how to update your code for this "bug fix" is likely sufficient.

comment:4 by Tim Graham <timograham@…>, 9 years ago

Resolution: fixed
Status: assignedclosed

In bc77eb6:

Fixed #24906 -- Fixed ResolverMatch.app_name for nested namespaces.

Set ResolverMatch.app_name to the full path of nested application
namespaces.

Note: See TracTickets for help on using tickets.
Back to Top