FIX DB: get non existent actions

This commit is contained in:
boyska 2016-10-04 10:30:56 +02:00
parent d525fbf20a
commit 1d911caa9c
No known key found for this signature in database
GPG key ID: 7395DCAE58289CA9

View file

@ -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()