fix:design progress
This commit is contained in:
@@ -72,7 +72,7 @@ class DesignProgressRepository(BaseRepository[CreateDesignProgress]):
|
|||||||
{"project_id": get_record.project_id, "type": int(get_record.type) - 1,
|
{"project_id": get_record.project_id, "type": int(get_record.type) - 1,
|
||||||
"completed_at": {"$exists": 1}})
|
"completed_at": {"$exists": 1}})
|
||||||
if not progress:
|
if not progress:
|
||||||
raise HTTPException(status_code=200, detail='before type not complete')
|
raise HTTPException(status_code=422, detail='before type not complete')
|
||||||
if get_record.type < 7:
|
if get_record.type < 7:
|
||||||
progress = await use_collection(COLLECTION).find(
|
progress = await use_collection(COLLECTION).find(
|
||||||
{"project_id": get_record.project_id, "type": int(get_record.type)+1}).to_list(None)
|
{"project_id": get_record.project_id, "type": int(get_record.type)+1}).to_list(None)
|
||||||
@@ -81,7 +81,7 @@ class DesignProgressRepository(BaseRepository[CreateDesignProgress]):
|
|||||||
records = await use_collection('design_progress_record').find_one(
|
records = await use_collection('design_progress_record').find_one(
|
||||||
{"design_progress_id": {"$in":ids}})
|
{"design_progress_id": {"$in":ids}})
|
||||||
if records:
|
if records:
|
||||||
raise HTTPException(status_code=200, detail='next record is exist')
|
raise HTTPException(status_code=422, detail='next record is exist')
|
||||||
|
|
||||||
return result
|
return result
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user