From e42de7957b9b51962c7d3a9e861f0e5cf67a804a Mon Sep 17 00:00:00 2001 From: DevArfat <43339946+arfathyahiya@users.noreply.github.com> Date: Thu, 21 Nov 2024 02:09:50 +0530 Subject: [PATCH] Complying black code style --- examples/basic_with_custom_state.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/examples/basic_with_custom_state.py b/examples/basic_with_custom_state.py index dd1ad99..938faa4 100644 --- a/examples/basic_with_custom_state.py +++ b/examples/basic_with_custom_state.py @@ -14,11 +14,13 @@ # startup is now deprecated https://fastapi.tiangolo.com/advanced/events/#alternative-events-deprecated # use lifespan https://fastapi.tiangolo.com/advanced/events/ + @asynccontextmanager async def lifespan(_app: FastAPI): await discord.init() yield + app = FastAPI() # @app.on_event("startup") @@ -70,7 +72,9 @@ async def client_session_error_handler(_, e: ClientSessionNotInitialized): return JSONResponse({"error": "Internal Error"}, status_code=500) -@app.get("/user", dependencies=[Depends(discord.requires_authorization)], response_model=User) +@app.get( + "/user", dependencies=[Depends(discord.requires_authorization)], response_model=User +) async def get_user(user: User = Depends(discord.user)): return user