inventorymgr/qualifications.py
def delete_qualification(qual_id: int) -> Dict[str, bool]:
    """API endpoint that deletes a qualification."""
    qualification_obj = api.Qualification.parse_obj(request.json)
    if qualification_obj.id != qual_id:
        raise APIError(reason="incorrect_id", status_code=400)

    if Qualification.query.filter_by(id=qual_id).count() < 1:
        raise APIError(reason="no_such_object", status_code=400)

    db.session.delete(Qualification.query.get(qual_id))
    db.session.commit()

    return {"success": True}
API endpoint that deletes a qualification.
API endpoint that deletes a qualification.
API endpoint that deletes a qualification .
def delete_qualification(qual_id: int) -> Dict[str, bool]:
    qualification_obj = api.Qualification.parse_obj(request.json)
    if qualification_obj.id != qual_id:
        raise APIError(reason="incorrect_id", status_code=400)
    if Qualification.query.filter_by(id=qual_id).count() < 1:
        raise APIError(reason="no_such_object", status_code=400)
    db.session.delete(Qualification.query.get(qual_id))
    db.session.commit()
    return {"success": True}
def delete_qualification ( qual_id : int ) -> Dict [ str , bool ] : qualification_obj = api . Qualification . parse_obj ( request . json ) if qualification_obj . id != qual_id : raise APIError ( reason = "incorrect_id" , status_code = 400 ) if Qualification . query . filter_by ( id = qual_id ) . count ( ) < 1 : raise APIError ( reason = "no_such_object" , status_code = 400 ) db . session . delete ( Qualification . query . get ( qual_id ) ) db . session . commit ( ) return { "success" : True }
API endpoint that deletes a qualification.
API endpoint that deletes a qualification .
"""API endpoint that deletes a qualification."""
qual_id
int