Skip to content

Commit

Permalink
Complying black code style
Browse files Browse the repository at this point in the history
  • Loading branch information
arfathyahiya authored Nov 20, 2024
1 parent beb2e79 commit e42de79
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion examples/basic_with_custom_state.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down Expand Up @@ -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

Expand Down

0 comments on commit e42de79

Please sign in to comment.