Merge branch 'ps' into 'main'

changes 删除bug

See merge request root/ModelStore!1
This commit is contained in:
王思川 2022-12-09 07:28:14 +00:00
commit fa8d6a4295
1 changed files with 5 additions and 0 deletions

View File

@ -29,6 +29,11 @@ def delete_scorecard(db: Session, mongodb: MongoHelper, _id: str):
return True return True
except IntegrityError: except IntegrityError:
return False return False
except AttributeError:
db.query(Model.ScoreCard).filter_by(id=_id).delete()
db.commit()
return True
def update_scorecard(db: Session, _id: str, schema: Schema.EditScoreCardReqBody): def update_scorecard(db: Session, _id: str, schema: Schema.EditScoreCardReqBody):