From e3c7d25b60c2aacc24898ec5371de414318fbe95 Mon Sep 17 00:00:00 2001 From: Sven Boor Date: Mon, 13 May 2024 11:30:41 +0200 Subject: [PATCH] Update policy with default. --- .gitignore | 1 + main.py | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index b1cb160..c893a2f 100644 --- a/.gitignore +++ b/.gitignore @@ -159,3 +159,4 @@ cython_debug/ # option (not recommended) you can uncomment the following to ignore the entire idea folder. #.idea/ +backup/ diff --git a/main.py b/main.py index 74e70dd..f3f1862 100644 --- a/main.py +++ b/main.py @@ -60,7 +60,7 @@ def delete_zones_route(delete_request: delete_zone.DeleteZonesRequest, current_u def get_zones_private( municipality: Union[str, None] = None, geography_types: list[zone.GeographyType] = Query(default=[]), - phases: Annotated[list[zone.Phase], Query()] = []): + phases: Annotated[list[zone.Phase], Query()] = [zone.Phase.active, zone.Phase.retirement_concept, zone.Phase.published_retirement, zone.Phase.committed_retire_concept]): if len(phases) == 0: raise HTTPException(status_code=400, detail="At least one phase in query parameter phases should be specified.") return get_zones.get_private_zones(municipality=municipality, geography_types=geography_types, phases=phases) @@ -69,7 +69,7 @@ def get_zones_private( def get_zones_public( municipality: Union[str, None] = None, geography_types: list[zone.GeographyType] = Query(default=[]), - phases: Annotated[list[zone.Phase], Query()] = []): + phases: Annotated[list[zone.Phase], Query()] = [zone.Phase.active, zone.Phase.retirement_concept, zone.Phase.published_retirement, zone.Phase.committed_retire_concept]): return get_zones.get_public_zones(municipality=municipality, geography_types=geography_types, phases=phases) @app.get("/public/service_area")