예제 #1
0
 def notify(self, alert, query, user, new_state, app, host):
     if self.destination:
         return self.destination.notify(alert, query, user, new_state, app, host)
     else:
         # User email subscription, so create an email destination object
         config = {"addresses": self.user.email}
         schema = get_configuration_schema_for_destination_type("email")
         options = ConfigurationContainer(config, schema)
         destination = get_destination("email", options)
         return destination.notify(alert, query, user, new_state, app, host, options)
예제 #2
0
파일: models.py 프로젝트: Drunkar/redash
 def notify(self, alert, query, user, new_state, app, host):
     if self.destination:
         return self.destination.notify(alert, query, user, new_state,
                                        app, host)
     else:
         # User email subscription, so create an email destination object
         config = {'addresses': self.user.email}
         schema = get_configuration_schema_for_destination_type('email')
         options = ConfigurationContainer(config, schema)
         destination = get_destination('email', options)
         return destination.notify(alert, query, user, new_state, app, host, options)
예제 #3
0
 def notify(self, alert, query, user, new_state, app, host):
     if self.destination:
         return self.destination.notify(alert, query, user, new_state, app,
                                        host)
     else:
         # User email subscription, so create an email destination object
         config = {'email': self.user.email}
         schema = get_configuration_schema_for_destination_type('email')
         options = ConfigurationContainer(json.dumps(config), schema)
         destination = get_destination('email', options)
         return destination.notify(alert, query, user, new_state, app, host,
                                   options)
예제 #4
0
파일: models.py 프로젝트: Drunkar/redash
 def destination(self):
     return get_destination(self.type, self.options)