Browse Source

Fix sodexo failing when no menu available

Toni Fadjukoff 7 years ago
parent
commit
c778908346
1 changed files with 3 additions and 0 deletions
  1. 3 0
      sodexo.py

+ 3 - 0
sodexo.py View File

27
                 continue
27
                 continue
28
             current_day_foods = []
28
             current_day_foods = []
29
             courses = data["courses"]
29
             courses = data["courses"]
30
+            print(data)
30
             for course_info in courses:
31
             for course_info in courses:
32
+                if not "category" in course_info or not "title_fi" in course_info or not "properties" in course_info:
33
+                    continue
31
                 if course_info["category"] != "Aamupuuro":
34
                 if course_info["category"] != "Aamupuuro":
32
                     food = course_info["title_fi"]
35
                     food = course_info["title_fi"]
33
                     if "properties" in course_info:
36
                     if "properties" in course_info: