Prechádzať zdrojové kódy

FIX DB: get non existent actions

boyska 7 rokov pred
rodič
commit
1d911caa9c
1 zmenil súbory, kde vykonal 3 pridanie a 1 odobranie
  1. 3 1
      larigira/event.py

+ 3 - 1
larigira/event.py

@@ -35,7 +35,9 @@ class EventModel(object):
 
     def get_actions_by_alarm(self, alarm):
         for action_id in alarm.get('actions', []):
-            yield self.get_action_by_id(action_id)
+            action = self.get_action_by_id(action_id)
+            if action is None: continue
+            yield action
 
     def get_all_alarms(self):
         return self.alarms.all()