This commit is contained in:
Colin Goutte 2021-09-29 11:55:27 +02:00
parent cb5af32b6a
commit e1a4449ad4
1 changed files with 5 additions and 2 deletions

View File

@ -77,8 +77,11 @@ def list_notification(idsonde: str):
@app.post("/sonde/{idsonde}/")
def post_sonde_data(idsonde: str, body: dict = Body(...)):
if idsonde not in sondes:
def post_sonde_data(
idsonde: str, body: dict = Body(...), db: Session = Depends(get_db)
):
if not (sonde := crud.get_sonde(db, idsonde)):
return
mesures_ = mesures[idsonde]