立项配置页初步优化
This commit is contained in:
@@ -17,6 +17,7 @@ async def log_action(
|
||||
detail: str | None,
|
||||
operator_id: uuid.UUID,
|
||||
operator_role: str,
|
||||
auto_commit: bool = True,
|
||||
) -> AuditLog:
|
||||
log = AuditLog(
|
||||
study_id=study_id,
|
||||
@@ -28,8 +29,11 @@ async def log_action(
|
||||
operator_role=operator_role,
|
||||
)
|
||||
db.add(log)
|
||||
await db.commit()
|
||||
await db.refresh(log)
|
||||
if auto_commit:
|
||||
await db.commit()
|
||||
await db.refresh(log)
|
||||
else:
|
||||
await db.flush()
|
||||
return log
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user