def _add_custom_immediate_rule(self, content_list):
     event_and_content_objects = [(AlertEvent(minutes_to_wait=i * 10),
                                   content)
                                  for i, content in enumerate(content_list)]
     schedule = AlertSchedule.create_custom_alert(
         self.domain, event_and_content_objects)
     return self._add_rule(alert_schedule_id=schedule.schedule_id)
def migrate_custom_alert_schedule(handler):
    return AlertSchedule.create_custom_alert(
        handler.domain,
        [(get_event(handler, event), get_content(handler, event))
         for event in handler.events],
        extra_options=get_extra_scheduling_options(handler),
    )