diff options
| author | Jake Howard <RealOrangeOne@users.noreply.github.com> | 2024-05-29 14:48:27 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-05-29 10:48:27 -0300 |
| commit | ff308a06047cd60806d604a7cf612e5656ee2ac9 (patch) | |
| tree | f2139fbf020cbdf33bad64a3377700623c18a44f /django/contrib/admin/options.py | |
| parent | 02dab94c7b8585c7ae3854465574d768e1df75d3 (diff) | |
Fixed 35467 -- Replaced urlparse with urlsplit where appropriate.
This work should not generate any change of functionality, and
`urlsplit` is approximately 6x faster.
Most use cases of `urlparse` didn't touch the path, so they can be
converted to `urlsplit` without any issue. Most of those which do use
`.path`, simply parse the URL, mutate the querystring, then put them
back together, which is also fine (so long as urlunsplit is used).
Diffstat (limited to 'django/contrib/admin/options.py')
| -rw-r--r-- | django/contrib/admin/options.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/django/contrib/admin/options.py b/django/contrib/admin/options.py index 12467de74d..9cc891d807 100644 --- a/django/contrib/admin/options.py +++ b/django/contrib/admin/options.py @@ -6,7 +6,7 @@ import warnings from functools import partial, update_wrapper from urllib.parse import parse_qsl from urllib.parse import quote as urlquote -from urllib.parse import urlparse +from urllib.parse import urlsplit from django import forms from django.conf import settings @@ -1384,7 +1384,7 @@ class ModelAdmin(BaseModelAdmin): ) def _get_preserved_qsl(self, request, preserved_filters): - query_string = urlparse(request.build_absolute_uri()).query + query_string = urlsplit(request.build_absolute_uri()).query return parse_qsl(query_string.replace(preserved_filters, "")) def response_add(self, request, obj, post_url_continue=None): |
