修复scalar_one_or_none相关limit
This commit is contained in:
@@ -228,6 +228,7 @@ async def optimize(
|
||||
Project.user_id == current_user.id,
|
||||
Project.deleted_at.is_(None),
|
||||
)
|
||||
.limit(1)
|
||||
)
|
||||
project = proj_result.scalar_one_or_none()
|
||||
if not project:
|
||||
@@ -460,6 +461,7 @@ async def update_prompt(
|
||||
GenerationRecord.user_id == current_user.id,
|
||||
GenerationRecord.deleted_at.is_(None),
|
||||
)
|
||||
.limit(1)
|
||||
)
|
||||
record = result.scalar_one_or_none()
|
||||
if not record:
|
||||
@@ -505,6 +507,7 @@ async def get_queue_status(
|
||||
GenerationRecord.user_id == current_user.id,
|
||||
GenerationRecord.deleted_at.is_(None),
|
||||
)
|
||||
.limit(1)
|
||||
)
|
||||
record = result.scalar_one_or_none()
|
||||
if not record:
|
||||
@@ -548,6 +551,7 @@ async def seedance_callback(request: Request, db: AsyncSession = Depends(get_db)
|
||||
GenerationRecord.seedance_task_id == task_id,
|
||||
GenerationRecord.deleted_at.is_(None),
|
||||
)
|
||||
.limit(1)
|
||||
)
|
||||
record = result.scalar_one_or_none()
|
||||
if not record:
|
||||
|
||||
Reference in New Issue
Block a user