fix: Lint fixes of core, models and schemas
All checks were successful
Backend CI / test (push) Successful in 4m5s
All checks were successful
Backend CI / test (push) Successful in 4m5s
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
from collections.abc import AsyncGenerator
|
||||
from collections.abc import AsyncGenerator, Callable
|
||||
|
||||
from sqlalchemy.ext.asyncio import AsyncEngine, create_async_engine
|
||||
from sqlmodel import SQLModel
|
||||
@@ -38,9 +38,9 @@ async def get_db() -> AsyncGenerator[AsyncSession, None]:
|
||||
await session.close()
|
||||
|
||||
|
||||
def get_session_factory():
|
||||
def get_session_factory() -> Callable[[], AsyncSession]:
|
||||
"""Get a session factory function for services."""
|
||||
def session_factory():
|
||||
def session_factory() -> AsyncSession:
|
||||
return AsyncSession(engine)
|
||||
return session_factory
|
||||
|
||||
|
||||
@@ -135,8 +135,6 @@ async def get_current_user_api_token(
|
||||
detail="Account is deactivated",
|
||||
)
|
||||
|
||||
return user
|
||||
|
||||
except HTTPException:
|
||||
# Re-raise HTTPExceptions without wrapping them
|
||||
raise
|
||||
@@ -146,6 +144,8 @@ async def get_current_user_api_token(
|
||||
status_code=status.HTTP_401_UNAUTHORIZED,
|
||||
detail="Could not validate API token",
|
||||
) from e
|
||||
else:
|
||||
return user
|
||||
|
||||
|
||||
async def get_current_user_flexible(
|
||||
|
||||
Reference in New Issue
Block a user