Merge pull request #1017 from grafana/fix_ag_filtering

Speedup search alertgroup to group alert
This commit is contained in:
Innokentii Konstantinov 2022-12-19 10:59:24 +08:00 committed by GitHub
commit 7bb4fdfe43
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -74,7 +74,7 @@ class AlertGroupQuerySet(models.QuerySet):
# Try to return the last open group
# Note that (channel, channel_filter, distinction, is_open_for_grouping) is in unique_together
try:
return self.get(**search_params, is_open_for_grouping=True), False
return self.get(**search_params, is_open_for_grouping__isnull=False), False
except self.model.DoesNotExist:
pass