Rework alert group mine filter query (#1466)
Rework query to make it more efficient.
This commit is contained in:
parent
7bad073626
commit
f5fb5d34dc
1 changed files with 7 additions and 2 deletions
|
|
@ -147,9 +147,14 @@ class AlertGroupFilter(DateRangeFilterMixin, ModelFieldFilterMixin, filters.Filt
|
|||
return queryset
|
||||
|
||||
queryset = queryset.filter(
|
||||
Q(personal_log_records__author__in=users) | Q(log_records__author__in=users)
|
||||
# user was notified
|
||||
Q(personal_log_records__author__in=users)
|
||||
|
|
||||
# or interacted with the alert group
|
||||
Q(acknowledged_by_user__pk__in=users)
|
||||
| Q(resolved_by_user__pk__in=users)
|
||||
| Q(silenced_by_user__pk__in=users)
|
||||
).distinct()
|
||||
|
||||
return queryset
|
||||
|
||||
def filter_mine(self, queryset, name, value):
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue