chore: format
This commit is contained in:
@@ -391,15 +391,11 @@ class ModelsTable:
|
||||
|
||||
return ModelListResponse(items=models, total=total)
|
||||
|
||||
async def get_model_meta_by_id(
|
||||
self, id: str, db: Optional[AsyncSession] = None
|
||||
) -> Optional[tuple[dict, int]]:
|
||||
async def get_model_meta_by_id(self, id: str, db: Optional[AsyncSession] = None) -> Optional[tuple[dict, int]]:
|
||||
"""Return (meta, updated_at) for a model, skipping access grant resolution."""
|
||||
try:
|
||||
async with get_async_db_context(db) as db:
|
||||
result = await db.execute(
|
||||
select(Model.meta, Model.updated_at).filter_by(id=id)
|
||||
)
|
||||
result = await db.execute(select(Model.meta, Model.updated_at).filter_by(id=id))
|
||||
return result.first()
|
||||
except Exception:
|
||||
return None
|
||||
|
||||
@@ -326,9 +326,7 @@ class OAuthSessionTable:
|
||||
"""Delete all OAuth sessions for a specific user and provider"""
|
||||
try:
|
||||
async with get_async_db_context(db) as db:
|
||||
result = await db.execute(
|
||||
delete(OAuthSession).filter_by(user_id=user_id, provider=provider)
|
||||
)
|
||||
result = await db.execute(delete(OAuthSession).filter_by(user_id=user_id, provider=provider))
|
||||
await db.commit()
|
||||
return result.rowcount > 0
|
||||
except Exception as e:
|
||||
|
||||
Reference in New Issue
Block a user