]> git.ipfire.org Git - thirdparty/fastapi/fastapi.git/commitdiff
♻️ Simplify string format with f-strings in `fastapi/applications.py` (#11335)
authorigeni <kublin@it8.ru>
Sun, 31 Mar 2024 16:37:21 +0000 (19:37 +0300)
committerGitHub <noreply@github.com>
Sun, 31 Mar 2024 16:37:21 +0000 (11:37 -0500)
fastapi/applications.py

index ffe9da35892d258cc8a189a79fa24117c2932e9b..d3edcc8802f9ea26401e4e32e9b79098dab794c8 100644 (file)
@@ -1019,7 +1019,7 @@ class FastAPI(Starlette):
                     oauth2_redirect_url = root_path + oauth2_redirect_url
                 return get_swagger_ui_html(
                     openapi_url=openapi_url,
-                    title=self.title + " - Swagger UI",
+                    title=f"{self.title} - Swagger UI",
                     oauth2_redirect_url=oauth2_redirect_url,
                     init_oauth=self.swagger_ui_init_oauth,
                     swagger_ui_parameters=self.swagger_ui_parameters,
@@ -1043,7 +1043,7 @@ class FastAPI(Starlette):
                 root_path = req.scope.get("root_path", "").rstrip("/")
                 openapi_url = root_path + self.openapi_url
                 return get_redoc_html(
-                    openapi_url=openapi_url, title=self.title + " - ReDoc"
+                    openapi_url=openapi_url, title=f"{self.title} - ReDoc"
                 )
 
             self.add_route(self.redoc_url, redoc_html, include_in_schema=False)