예제 #1
0
 def _get_notification(self, n_p, env_id, event_name, curs):
     n_f = NotificatonFilter(env_id, {'event': event_name,
         'type': Notification.TYPE_EMAIL}, {}, None)
     try:
         notif = n_f.filter_one_obj(curs)
         if notif.is_active:
             n_p.add_step(n_p.STEP_EVENT_NOTIFICATION_ENABLED)
         else:
             n_p.add_step(n_p.STEP_EVENT_NOTIFICATION_DISABLED)
             raise NotificatoinPreparingError()
         return notif
     except NotificatonNotFound:
         n_p.add_step(n_p.STEP_UNKNOWN_EVENT)
     raise NotificatoinPreparingError()