Sfoglia il codice sorgente

beer.xml exports from "BrewersFriend" can contain a tag like "<STEP_TIME></STEP_TIME>" which led to a float converting error. Now this will be interpreted as Step_Time = 0.0

pull/194/head
Johannes 7 anni fa
parent
commit
a3bbbccfc9
1 ha cambiato i file con 6 aggiunte e 1 eliminazioni
  1. +6
    -1
      modules/recipe_import/beerxml.py

+ 6
- 1
modules/recipe_import/beerxml.py Vedi File

@@ -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



Loading…
Annulla
Salva