Browse Source

Fix sodexo failing when no menu available

Toni Fadjukoff 6 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,7 +27,10 @@ def get_restaurants(use_old, week):
27 27
                 continue
28 28
             current_day_foods = []
29 29
             courses = data["courses"]
30
+            print(data)
30 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 34
                 if course_info["category"] != "Aamupuuro":
32 35
                     food = course_info["title_fi"]
33 36
                     if "properties" in course_info: