From a3bbbccfc91e118fbdaed3865a139c5c23189d6f Mon Sep 17 00:00:00 2001 From: Johannes Date: Sun, 28 Oct 2018 08:57:36 +0100 Subject: [PATCH] beer.xml exports from "BrewersFriend" can contain a tag like "" which led to a float converting error. Now this will be interpreted as Step_Time = 0.0 --- modules/recipe_import/beerxml.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/modules/recipe_import/beerxml.py b/modules/recipe_import/beerxml.py index 5e39d11..98748c0 100644 --- a/modules/recipe_import/beerxml.py +++ b/modules/recipe_import/beerxml.py @@ -141,7 +141,12 @@ class BeerXMLImport(FlaskView): else: temp = round(9.0 / 5.0 * float(e.find("STEP_TEMP").text) + 32, 2) - steps.append({"name": e.find("NAME").text, "temp": temp, "timer": float(e.find("STEP_TIME").text)}) + if e.find("STEP_TIME").text is None: + stepTime = 0.0 + else: + stepTime = float(e.find("STEP_TIME").text) + + steps.append({"name": e.find("NAME").text, "temp": temp, "timer": stepTime}) return steps