forked from GithubBackups/healthchecks
Reduce the number of SQL queries in the "Check Details" page.
This commit is contained in:
parent
eb7f51f6f5
commit
fcf11d5b4f
@ -521,6 +521,7 @@ def details(request, code):
|
||||
"project": check.project,
|
||||
"check": check,
|
||||
"channels": channels,
|
||||
"enabled_channels": list(check.channel_set.all()),
|
||||
"timezones": pytz.all_timezones,
|
||||
"downtimes": check.downtimes(months=3),
|
||||
"is_new": "new" in request.GET,
|
||||
|
@ -193,10 +193,10 @@
|
||||
<h2>Notification Methods</h2>
|
||||
<table id="details-integrations" class="table">
|
||||
{% for channel in channels %}
|
||||
<tr data-url="{% url 'hc-switch-channel' check.code channel.code %}" {% if channel in check.channel_set.all %}class="on"{% endif %}>
|
||||
<tr data-url="{% url 'hc-switch-channel' check.code channel.code %}" {% if channel in enabled_channels %}class="on"{% endif %}>
|
||||
<th>
|
||||
<span class="label">
|
||||
{% if channel in check.channel_set.all %}ON{% else %}OFF{% endif %}
|
||||
{% if channel in enabled_channels %}ON{% else %}OFF{% endif %}
|
||||
</span>
|
||||
</th>
|
||||
<td>
|
||||
|
Loading…
x
Reference in New Issue
Block a user