From 3688617cb98eed888968815ee316ee0f4710ef60 Mon Sep 17 00:00:00 2001 From: sbgap Date: Mon, 27 Apr 2026 10:11:21 +0200 Subject: [PATCH] feat: remove repeat-type and use and function for all fields --- alerta/database/backends/postgres/base.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/alerta/database/backends/postgres/base.py b/alerta/database/backends/postgres/base.py index df3172bbf..f054da0d5 100644 --- a/alerta/database/backends/postgres/base.py +++ b/alerta/database/backends/postgres/base.py @@ -1963,14 +1963,11 @@ def get_on_calls_active(self, alert): SELECT * FROM on_calls WHERE ((start_time IS NULL OR start_time <= %(time)s) AND (end_time IS NULL OR end_time > %(time)s)) + AND ((start_date IS NULL OR start_date <= %(date)s) AND (end_date IS NULL OR end_date >= %(date)s)) AND ( - (start_date = %(date)s) OR (start_date < %(date)s AND end_date >= %(date)s) - OR ( - repeat_type = 'list' - AND (repeat_days IS NULL OR repeat_days='{}' OR ARRAY[%(day)s] <@ repeat_days) + (repeat_days IS NULL OR repeat_days='{}' OR ARRAY[%(day)s] <@ repeat_days) AND (repeat_weeks IS NULL OR repeat_weeks='{}' OR ARRAY[%(week)s] <@ repeat_weeks) AND (repeat_months IS NULL OR repeat_months='{}' OR ARRAY[%(month)s] <@ repeat_months) - ) ) """