Skip to content

Commit

Permalink
fixup! Filter for sent/error
Browse files Browse the repository at this point in the history
  • Loading branch information
kfdm committed Aug 1, 2023
1 parent 1e9c6cc commit 6d9030e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions promgen/templates/promgen/alert_list.html
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@
<th>Service</th>
<th>Project</th>
<th>Job</th>
<th><a href="?sent=0">Sent</a></th>
<th><a href="?error=1">Error</a></th>
<th><a href="?noSent=1">Sent</a></th>
<th><a href="?sentError=1">Error</a></th>
</tr>
{% for alert in alert_list %}
{% ifchanged alert.created|date %}
Expand Down
4 changes: 2 additions & 2 deletions promgen/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -1015,9 +1015,9 @@ def get_queryset(self):
for key, value in self.request.GET.items():
if key in ["page", "search"]:
continue
elif key == "sent":
elif key == "noSent":
qs = qs.filter(sent_count=0)
elif key == "error":
elif key == "sentError":
qs = qs.exclude(error_count=0)
else:
qs = qs.filter(alertlabel__name=key, alertlabel__value=value)
Expand Down

0 comments on commit 6d9030e

Please sign in to comment.