소스 검색

Fixing KeyError

Foppe Hemminga 6 년 전
부모
커밋
8e051fc036
1개의 변경된 파일1개의 추가작업 그리고 1개의 파일을 삭제
  1. 1 1
      main.py

+ 1 - 1
main.py

@@ -66,7 +66,7 @@ if __name__ == '__main__':
             if 'alert' in temp_status_json:
                 alerts = temp_status_json['alert']
             else:
-                alerts = {'15': False, '10': False, '5': False, '1': False}
+                temp_status_json['alert'] = {'15': False, '10': False, '5': False, '1': False}
             if not alerts[str(minutes_to_go)]:
                 # We have not sent this alert before
                 name_alert = status['name']