aboutsummaryrefslogtreecommitdiffstats
path: root/backend/routes/index.py
diff options
context:
space:
mode:
authorGravatar Joe Banks <[email protected]>2024-07-07 02:29:26 +0100
committerGravatar Joe Banks <[email protected]>2024-07-08 15:00:10 +0100
commitd0e09d2ba567f23d91ac76d1844966bafb9b063a (patch)
tree9e825e3f09df02ab32e401c7e9555df26356dd4c /backend/routes/index.py
parentChange linting config to Ruff (diff)
Apply fixable lint settings with Ruff
Diffstat (limited to 'backend/routes/index.py')
-rw-r--r--backend/routes/index.py21
1 files changed, 9 insertions, 12 deletions
diff --git a/backend/routes/index.py b/backend/routes/index.py
index 207c36a..c6e38ea 100644
--- a/backend/routes/index.py
+++ b/backend/routes/index.py
@@ -1,6 +1,5 @@
-"""
-Index route for the forms API.
-"""
+"""Index route for the forms API."""
+
import platform
from pydantic import BaseModel
@@ -20,13 +19,13 @@ class IndexResponse(BaseModel):
description=(
"The connecting client, in production this will"
" be an IP of our internal load balancer"
- )
+ ),
)
sha: str = Field(
- description="Current release Git SHA in production."
+ description="Current release Git SHA in production.",
)
node: str = Field(
- description="The node that processed the request."
+ description="The node that processed the request.",
)
@@ -42,24 +41,22 @@ class IndexRoute(Route):
@api.validate(resp=Response(HTTP_200=IndexResponse))
def get(self, request: Request) -> JSONResponse:
- """
- Return a hello from Python Discord forms!
- """
+ """Return a hello from Python Discord forms!."""
response_data = {
"message": "Hello, world!",
"client": request.client.host,
"user": {
- "authenticated": False
+ "authenticated": False,
},
"sha": GIT_SHA,
- "node": platform.uname().node
+ "node": platform.uname().node,
}
if request.user.is_authenticated:
response_data["user"] = {
"authenticated": True,
"user": request.user.payload,
- "scopes": request.auth.scopes
+ "scopes": request.auth.scopes,
}
return JSONResponse(response_data)