1
0
mirror of https://github.com/django/django.git synced 2025-01-27 02:29:55 +00:00

Replaced old formatting with f-strings.

This commit is contained in:
GappleBee 2024-11-21 19:04:47 +00:00
parent c7647e005f
commit 1dc83aceb6

View File

@ -260,10 +260,10 @@ class HttpRequest:
Return an absolute URI from variables available in this request. Skip
allowed hosts protection, so may return insecure URI.
"""
return "{scheme}://{host}{path}".format(
scheme=self.scheme,
host=self._get_parsed_host_header(validate=False).combined,
path=self.get_full_path(),
return (
f"{self.scheme}://"
f"{self._get_parsed_host_header(validate=False).combined}"
f"{self.get_full_path()}"
)
def build_absolute_uri(self, location=None):
@ -307,7 +307,7 @@ class HttpRequest:
@cached_property
def _current_scheme_host(self):
return "{}://{}".format(self.scheme, self.get_host())
return f"{self.scheme}://{self.get_host()}"
def _get_scheme(self):
"""