Skip to content

Commit

Permalink
[feature #141392693] Use list comprehension for failed jobs
Browse files Browse the repository at this point in the history
  • Loading branch information
wanjikum committed Apr 13, 2017
1 parent ac13748 commit caf5ff1
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions hc/front/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,10 +107,8 @@ def docs(request):
@login_required
def reports(request):
checks = Check.objects.filter(user=request.team.user).order_by("created")
failed_checks = []
for check in checks:
if check.get_status() == "down" and check.n_pings:
failed_checks.append(check)
failed_checks = [check for check in checks
if check.get_status() == "down" and check.n_pings]
ctx = {
"page": "reports",
"checks": failed_checks,
Expand Down

0 comments on commit caf5ff1

Please sign in to comment.