Skip to content

Commit

Permalink
Fix check plugins not displaying checks correctly on service details
Browse files Browse the repository at this point in the history
  • Loading branch information
frankh committed Sep 14, 2017
1 parent 0979335 commit 8450b0b
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 4 deletions.
5 changes: 5 additions & 0 deletions CHANGES
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
master
------

* Fix check plugins not displaying checks correctly on service details page

Version 0.11.6
--------------

Expand Down
1 change: 1 addition & 0 deletions cabot/cabotapp/models/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ def get_custom_check_plugins():
custom_check['creation_url'] = "create-" + check_name + "-check"
custom_check['check_name'] = check_name
custom_check['icon_class'] = getattr(check, "icon_class", "glyphicon-ok")
custom_check['objects'] = check.objects
custom_check_types.append(custom_check)

return custom_check_types
Expand Down
4 changes: 4 additions & 0 deletions cabot/cabotapp/templatetags/extra.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,7 @@ def echo_setting(setting):
def format_timedelta(delta):
# Getting rid of microseconds.
return str(timedelta(days=delta.days, seconds=delta.seconds))

@register.filter
def for_service(objects, service):
return objects.filter(service=service)
6 changes: 2 additions & 4 deletions cabot/templates/cabotapp/service_detail.html
Original file line number Diff line number Diff line change
Expand Up @@ -103,11 +103,9 @@ <h3>

{% include 'cabotapp/_statuscheck_list.html' with checks=service.jenkins_status_checks.all service=service checks_type="Jenkins" %}

{% for custom_check in custom_check_types %}
<hr>

{% for check_class in custom_check_types %}
<hr>
{% include 'cabotapp/_statuscheck_list.html' with checks=check_class.objects.all service=service checks_type=check_class.check_name %}
{% include 'cabotapp/_statuscheck_list.html' with checks=custom_check.objects|for_service:service service=service checks_type=custom_check.check_name %}
{% endfor %}
<hr>

Expand Down

0 comments on commit 8450b0b

Please sign in to comment.