Skip to content

Commit

Permalink
fix sla violation filter to return only active, sla violating findings
Browse files Browse the repository at this point in the history
  • Loading branch information
blakeaowens committed Jan 10, 2024
1 parent 970fa5c commit 7d41feb
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions dojo/filters.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,8 +153,8 @@ def sla_satisfied(self, qs, name):
return qs.filter(Q(sla_expiration_date__isnull=True) | Q(sla_expiration_date__gt=timezone.now().date()))

def sla_violated(self, qs, name):
# return findings that have an sla expiration date before today
return qs.filter(sla_expiration_date__lt=timezone.now().date())
# return active findings that have an sla expiration date before today
return qs.filter(Q(active=True) & Q(sla_expiration_date__lt=timezone.now().date()))

options = {
None: (_('Any'), any),
Expand Down

0 comments on commit 7d41feb

Please sign in to comment.