From dfe40d059974e112cd963804482519d84f42a08b Mon Sep 17 00:00:00 2001 From: sbgap Date: Tue, 21 Jul 2026 09:30:37 +0200 Subject: [PATCH] fix: return 404 when receiving unknown id --- alerta/views/notification_rules.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/alerta/views/notification_rules.py b/alerta/views/notification_rules.py index 8332a0aaf..1f90acc2f 100644 --- a/alerta/views/notification_rules.py +++ b/alerta/views/notification_rules.py @@ -104,9 +104,9 @@ def get_notification_rule(notification_rule_id): @jsonp def get_notification_rule_history(notification_rule_id): notification_rule = NotificationRule.find_by_id(notification_rule_id) - total = notification_rule.history_count() - paging = Page.from_params(request.args, total) if notification_rule: + total = notification_rule.history_count() + paging = Page.from_params(request.args, total) notification_rule_history = [h.serialize for h in notification_rule.get_notification_rule_history(page=paging.page, page_size=paging.page_size)] return jsonify( status='ok',