mirror of
https://github.com/django/django.git
synced 2025-06-05 19:49:13 +00:00
Replaced old formatting with f-strings.
This commit is contained in:
parent
c7647e005f
commit
1dc83aceb6
@ -260,10 +260,10 @@ class HttpRequest:
|
|||||||
Return an absolute URI from variables available in this request. Skip
|
Return an absolute URI from variables available in this request. Skip
|
||||||
allowed hosts protection, so may return insecure URI.
|
allowed hosts protection, so may return insecure URI.
|
||||||
"""
|
"""
|
||||||
return "{scheme}://{host}{path}".format(
|
return (
|
||||||
scheme=self.scheme,
|
f"{self.scheme}://"
|
||||||
host=self._get_parsed_host_header(validate=False).combined,
|
f"{self._get_parsed_host_header(validate=False).combined}"
|
||||||
path=self.get_full_path(),
|
f"{self.get_full_path()}"
|
||||||
)
|
)
|
||||||
|
|
||||||
def build_absolute_uri(self, location=None):
|
def build_absolute_uri(self, location=None):
|
||||||
@ -307,7 +307,7 @@ class HttpRequest:
|
|||||||
|
|
||||||
@cached_property
|
@cached_property
|
||||||
def _current_scheme_host(self):
|
def _current_scheme_host(self):
|
||||||
return "{}://{}".format(self.scheme, self.get_host())
|
return f"{self.scheme}://{self.get_host()}"
|
||||||
|
|
||||||
def _get_scheme(self):
|
def _get_scheme(self):
|
||||||
"""
|
"""
|
||||||
|
Loading…
x
Reference in New Issue
Block a user