From a03047a6ae731f7c8003da92613ef19f7c0befd5 Mon Sep 17 00:00:00 2001 From: Jean-Romain Garnier Date: Wed, 22 Apr 2020 18:45:43 +0200 Subject: [PATCH] Handle empty dates in machine history results view --- logs/templates/logs/machine_history.html | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/logs/templates/logs/machine_history.html b/logs/templates/logs/machine_history.html index c2ad7368..e1c510ed 100644 --- a/logs/templates/logs/machine_history.html +++ b/logs/templates/logs/machine_history.html @@ -48,8 +48,20 @@ with this program; if not, write to the Free Software Foundation, Inc., {{ event.ipv4 }} {{ event.mac }} - {{ event.start_date }} - {{ event.end_date }} + + {% if event.start_date %} + {{ event.start_date }} + {% else %} + {% trans "Unknown" %} + {% endif %} + + + {% if event.start_date %} + {{ event.end_date }} + {% else %} + {% trans "Now" %} + {% endif %} + {{ event.comment }} {% endfor %}