From b7f157d25624357cde4747146bc92ef960e4c9af Mon Sep 17 00:00:00 2001 From: v00g100skr Date: Wed, 9 Oct 2024 23:00:37 +0300 Subject: [PATCH] fix etryvoga distract parser --- deploy/etryvoga/etryvoga.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/deploy/etryvoga/etryvoga.py b/deploy/etryvoga/etryvoga.py index 8b2e1977..05d881bd 100644 --- a/deploy/etryvoga/etryvoga.py +++ b/deploy/etryvoga/etryvoga.py @@ -186,11 +186,13 @@ async def districts_data(mc): def make_districts_struct(data): struct = {} - for district in data: - district_slug = district["slug"] - struct[district_slug] = district_slug - for city in district["cities"]: - struct[city["slug"]] = district_slug + for area in data: + area_slug = area["slug"] + struct[area_slug] = area_slug + for district in area["districts"]: + struct[district["slug"]] = area_slug + for city in district["cities"]: + struct[city["slug"]] = area_slug return struct