From 1dc83aceb6bcfdebf61994b166139fba5bc185d3 Mon Sep 17 00:00:00 2001 From: GappleBee Date: Thu, 21 Nov 2024 19:04:47 +0000 Subject: [PATCH] Replaced old formatting with f-strings. --- django/http/request.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/django/http/request.py b/django/http/request.py index abd8d80636..cb7a9a50f3 100644 --- a/django/http/request.py +++ b/django/http/request.py @@ -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): """