From ffc6f67f66286b9fe890514ee361f06122bc92f4 Mon Sep 17 00:00:00 2001 From: april Date: Mon, 15 Jan 2024 14:31:37 -0600 Subject: [PATCH] Fix accepted flight fields --- api/database/flights.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/api/database/flights.py b/api/database/flights.py index ffa8039..b491a07 100644 --- a/api/database/flights.py +++ b/api/database/flights.py @@ -16,8 +16,7 @@ from schemas.flight import FlightConciseSchema, FlightDisplaySchema, FlightCreat logger = logging.getLogger("api") -fs_keys = list(FlightCreateSchema.__annotations__.keys()) -fs_keys.extend(list(FlightDisplaySchema.__annotations__.keys())) +fs_keys = list(FlightPatchSchema.__annotations__.keys()) + list(FlightDisplaySchema.__annotations__.keys()) async def retrieve_flights(user: str = "", sort: str = "date", order: int = -1, filter: str = "", @@ -224,6 +223,7 @@ async def update_flight_fields(id: str, update: dict) -> str: :param update: Dictionary of fields and values to update :return: ID of updated flight """ + print(fs_keys) for field in update.keys(): if field not in fs_keys: raise HTTPException(400, f"Invalid update field: {field}")