mirror of
https://github.com/django/django.git
synced 2025-10-31 09:41:08 +00:00
Fixed #25610 -- Reverted removal of request.current_app in {% url %} tag.
The deprecation removal in 5e450c52aa
removed too much.
This commit is contained in:
committed by
Tim Graham
parent
23073f9644
commit
34af2bc523
@@ -434,9 +434,12 @@ class URLNode(Node):
|
||||
}
|
||||
view_name = self.view_name.resolve(context)
|
||||
try:
|
||||
current_app = context.request.resolver_match.namespace
|
||||
current_app = context.request.current_app
|
||||
except AttributeError:
|
||||
current_app = None
|
||||
try:
|
||||
current_app = context.request.resolver_match.namespace
|
||||
except AttributeError:
|
||||
current_app = None
|
||||
# Try to look up the URL. If it fails, raise NoReverseMatch unless the
|
||||
# {% url ... as var %} construct is used, in which case return nothing.
|
||||
url = ''
|
||||
|
||||
Reference in New Issue
Block a user