From 102c20ac4233769bc4ad0e45a4e0da9b795ec6b6 Mon Sep 17 00:00:00 2001 From: Viktor Barzin Date: Mon, 26 May 2025 19:31:33 +0000 Subject: [PATCH] [bugfix] if no district is passed, fetch data for all --- crawler/1_dump_listings.py | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/crawler/1_dump_listings.py b/crawler/1_dump_listings.py index da36915..43c2512 100644 --- a/crawler/1_dump_listings.py +++ b/crawler/1_dump_listings.py @@ -28,11 +28,14 @@ async def dump_listings( parameters: QueryParameters, data_dir: pathlib.Path = pathlib.Path("data/rs/"), ) -> list[Listing]: - districts = { - district: locid - for district, locid in get_districts().items() - if district in parameters.district_names - } + if parameters.district_names: + districts = { + district: locid + for district, locid in get_districts().items() + if district in parameters.district_names + } + else: + districts = get_districts() print("Valid districts to scrape:", districts.keys()) listings = []