From 37efed8d30888d36461270a8c8d6d7f630c3a982 Mon Sep 17 00:00:00 2001 From: Alejandro Sirgo Rica Date: Thu, 8 Aug 2024 15:54:56 +0200 Subject: template: prevent backtrace in /client/list Don't access client.speed if the field is not present. --- ogcp/templates/client_list.html | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'ogcp/templates') diff --git a/ogcp/templates/client_list.html b/ogcp/templates/client_list.html index 188cc2a..cd07118 100644 --- a/ogcp/templates/client_list.html +++ b/ogcp/templates/client_list.html @@ -34,10 +34,14 @@ {{ client_data.addr }} - {% if client_data.speed >= 1000 %} - {{ (client_data.speed / 1000) | int }} Gb/s + {% if client_data.speed is not none %} + {% if client_data.speed >= 1000 %} + {{ (client_data.speed / 1000) | int }} Gb/s + {% else %} + {{ client_data.speed }} Mb/s + {% endif %} {% else %} - {{ client_data.speed }} Mb/s + {{ _('Not available') }} {% endif %} {{ _('View details') }} -- cgit v1.2.3-18-g5258