From 75d2af2c895d5e08d8bfaa774c54071117c17c74 Mon Sep 17 00:00:00 2001 From: Florian Apolloner Date: Sun, 4 Oct 2020 14:58:54 +0200 Subject: [PATCH] Removed unneeded iri_to_uri() call in reverse(). _reverse_with_prefix() already quotes using a stricter subset of the safe characters used by iri_to_uri(). --- django/urls/base.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/django/urls/base.py b/django/urls/base.py index dd9b2e4c22..3899feeefb 100644 --- a/django/urls/base.py +++ b/django/urls/base.py @@ -2,7 +2,6 @@ from urllib.parse import urlsplit, urlunsplit from asgiref.local import Local -from django.utils.encoding import iri_to_uri from django.utils.functional import lazy from django.utils.translation import override @@ -84,7 +83,7 @@ def reverse(viewname, urlconf=None, args=None, kwargs=None, current_app=None): if ns_pattern: resolver = get_ns_resolver(ns_pattern, resolver, tuple(ns_converters.items())) - return iri_to_uri(resolver._reverse_with_prefix(view, prefix, *args, **kwargs)) + return resolver._reverse_with_prefix(view, prefix, *args, **kwargs) reverse_lazy = lazy(reverse, str)