Speedup seach alertgroup

This commit is contained in:
Innokentii Konstantinov 2022-12-17 19:34:13 +08:00
parent 5036d719d7
commit 41f886b31e

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