Handle missing hobbs value
This commit is contained in:
parent
ffc6f67f66
commit
cf157656f4
@ -203,7 +203,7 @@ async def update_flight(body: FlightCreateSchema, id: str) -> str:
|
||||
raise HTTPException(404, "Aircraft not found")
|
||||
|
||||
# Update hobbs of aircraft to reflect new hobbs end
|
||||
if body.hobbs_end > 0 and body.hobbs_end != aircraft.hobbs:
|
||||
if body.hobbs_end and body.hobbs_end and 0 < aircraft.hobbs != body.hobbs_end:
|
||||
await update_aircraft_field("hobbs", body.hobbs_end, aircraft.id)
|
||||
|
||||
# Update flight in database
|
||||
|
Loading…
x
Reference in New Issue
Block a user