소스 검색

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 년 전
부모
커밋
a3bbbccfc9
1개의 변경된 파일6개의 추가작업 그리고 1개의 파일을 삭제
  1. +6
    -1
      modules/recipe_import/beerxml.py

+ 6
- 1
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



불러오는 중...
취소
저장