Skip to content
Snippets Groups Projects

bugfix error 500 when click service hold/resume button

Merged Nico Vermaas requested to merge 594-improve-monitoring-page into master
3 files
+ 6
5
Compare changes
  • Side-by-side
  • Inline

Files

@@ -287,9 +287,9 @@ def convert_monitor_to_html(request, monitor_data):
@@ -287,9 +287,9 @@ def convert_monitor_to_html(request, monitor_data):
# only provide the hold/resume buttons for superusers, otherwise just show the state
# only provide the hold/resume buttons for superusers, otherwise just show the state
if request.user.is_superuser:
if request.user.is_superuser:
if record.enabled=="True":
if record.enabled=="True":
service_enabled = str(record.enabled) + '&nbsp;&nbsp; <a href="service_hold_resume/' + str(record.pk) + '/False"' + 'class="btn btn-warning btn-sm" role="button"><i class="fas fa-pause"></i> Hold</a>'
service_enabled = str(record.enabled) + '&nbsp;&nbsp; <a href="service_hold_resume/' + record.name + '/' + record.hostname + '/False"' + 'class="btn btn-warning btn-sm" role="button"><i class="fas fa-pause"></i> Hold</a>'
else:
else:
service_enabled = str(record.enabled) + '&nbsp;&nbsp; <a href="service_hold_resume/' + str(record.pk) + '/True"' + 'class="btn btn-success btn-sm" role="button"><i class="fas fa-play"></i> Resume</a>'
service_enabled = str(record.enabled) + '&nbsp;&nbsp; <a href="service_hold_resume/' + record.name + '/' + record.hostname + '/True"' + 'class="btn btn-success btn-sm" role="button"><i class="fas fa-play"></i> Resume</a>'
else:
else:
service_enabled = str(record.enabled)
service_enabled = str(record.enabled)
Loading