1
0
mirror of https://github.com/django/django.git synced 2025-03-13 10:50:55 +00:00

Fixed #35807 -- Mentioned async case for internal get/set urlconf helpers.

This commit is contained in:
Carlton Gibson 2024-10-07 10:07:39 +02:00 committed by Sarah Boyce
parent c334c1a8ff
commit d876be794f

View File

@ -127,8 +127,9 @@ def clear_script_prefix():
def set_urlconf(urlconf_name): def set_urlconf(urlconf_name):
""" """
Set the URLconf for the current thread (overriding the default one in Set the URLconf for the current thread or asyncio task (overriding the
settings). If urlconf_name is None, revert back to the default. default one in settings). If urlconf_name is None, revert back to the
default.
""" """
if urlconf_name: if urlconf_name:
_urlconfs.value = urlconf_name _urlconfs.value = urlconf_name
@ -139,8 +140,8 @@ def set_urlconf(urlconf_name):
def get_urlconf(default=None): def get_urlconf(default=None):
""" """
Return the root URLconf to use for the current thread if it has been Return the root URLconf to use for the current thread or asyncio task if it
changed from the default one. has been changed from the default one.
""" """
return getattr(_urlconfs, "value", default) return getattr(_urlconfs, "value", default)