diff --git a/keep/api/core/db.py b/keep/api/core/db.py index f4f94a649..849254cdd 100644 --- a/keep/api/core/db.py +++ b/keep/api/core/db.py @@ -1291,6 +1291,7 @@ def get_last_alerts( ).label("incidents"), ) .filter(LastAlertToIncident.deleted_at == NULL_FOR_DELETED_AT) + .group_by(LastAlertToIncident.fingerprint) .subquery() ) @@ -1304,6 +1305,7 @@ def get_last_alerts( ).label("incidents"), ) .filter(LastAlertToIncident.deleted_at == NULL_FOR_DELETED_AT) + .group_by(LastAlertToIncident.fingerprint) .subquery() ) @@ -1318,6 +1320,7 @@ def get_last_alerts( ).label("incidents"), ) .filter(LastAlertToIncident.deleted_at == NULL_FOR_DELETED_AT) + .group_by(LastAlertToIncident.fingerprint) .subquery() ) else: