From 9ba70dfe020fd1f503efe6d7050ab52b2803a6f0 Mon Sep 17 00:00:00 2001 From: Niko Strijbol Date: Mon, 4 Sep 2023 23:34:31 +0200 Subject: [PATCH] Fix allergens --- server/scraper/resto/allergens.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/server/scraper/resto/allergens.py b/server/scraper/resto/allergens.py index b268d211..f6eea428 100755 --- a/server/scraper/resto/allergens.py +++ b/server/scraper/resto/allergens.py @@ -28,8 +28,12 @@ def parse_section_item(section_item: str) -> Union[dict[str, list[str]], None]: """ Parses strings of the form `food: allergen, allergen, allergen` """ - - item_name, item_allergen_list = section_item.split(":") + + if "soep van de dag" in section_item: + item_name = "Soep van de dag" + item_allergen_list = section_item + else: + item_name, item_allergen_list = section_item.split(":") # Sometimes a section will have extra info before the item list, # this should not be parsed