fix: remove unused imports and rename shadowing parameters in main.py
This commit is contained in:
parent
ffa037e240
commit
f3781b0de1
@ -8,11 +8,9 @@ from fastapi.staticfiles import StaticFiles
|
||||
from fastapi.templating import Jinja2Templates
|
||||
|
||||
from app.core.config import get_settings
|
||||
from app.core.database import get_db
|
||||
from app.modules.auth.dependencies import (
|
||||
RequiresLoginException,
|
||||
check_permission,
|
||||
get_current_user,
|
||||
get_current_user_optional,
|
||||
)
|
||||
from app.modules.auth.router import router as auth_router
|
||||
@ -89,7 +87,7 @@ def _reset_admin() -> None:
|
||||
|
||||
|
||||
@asynccontextmanager
|
||||
async def lifespan(app: FastAPI):
|
||||
async def lifespan(_app: FastAPI):
|
||||
_reset_admin()
|
||||
yield
|
||||
|
||||
@ -115,7 +113,7 @@ for _module in MODULES:
|
||||
|
||||
|
||||
@app.exception_handler(RequiresLoginException)
|
||||
async def requires_login_handler(request: Request, exc: RequiresLoginException):
|
||||
async def requires_login_handler(_request: Request, _exc: RequiresLoginException):
|
||||
return RedirectResponse(url="/auth/login", status_code=307)
|
||||
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user