未知(继上次中断)
This commit is contained in:
@@ -84,6 +84,11 @@ async def update_study(
|
||||
status_code=status.HTTP_403_FORBIDDEN,
|
||||
detail="项目已锁定,无法编辑。请先解锁项目。"
|
||||
)
|
||||
|
||||
if study_in.code and study_in.code != study.code:
|
||||
existing = await study_crud.get_by_code(db, study_in.code)
|
||||
if existing and existing.id != study.id:
|
||||
raise HTTPException(status_code=status.HTTP_409_CONFLICT, detail="项目编号已存在")
|
||||
|
||||
updated = await study_crud.update(db, study, study_in)
|
||||
return updated
|
||||
|
||||
Reference in New Issue
Block a user