Procházet zdrojové kódy

Better logic, cleaner code

Foppe Hemminga před 6 roky
rodič
revize
e0b7b017c7
1 změnil soubory, kde provedl 2 přidání a 3 odebrání
  1. 2 3
      main.py

+ 2 - 3
main.py

@@ -63,10 +63,9 @@ if __name__ == '__main__':
             temp_status_json, _ = model.get_json_file(player_id)
             print(f'{minutes_to_go}: temp_status_json: ')
             pprint(temp_status_json)
-            if 'alert' in temp_status_json:
-                alerts = temp_status_json['alert']
-            else:
+            if 'alert' not in temp_status_json:
                 temp_status_json['alert'] = {'15': False, '10': False, '5': False, '1': False}
+            alerts = temp_status_json['alert']
             if not alerts[str(minutes_to_go)]:
                 # We have not sent this alert before
                 name_alert = status['name']