summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlejandro Sirgo Rica <asirgo@soleta.eu>2024-05-27 10:35:10 +0200
committerAlejandro Sirgo Rica <asirgo@soleta.eu>2024-05-30 15:50:37 +0200
commit1f18af1208ede0b16da393641e7e1386690e7aa5 (patch)
tree29dfc2e3a0ef82d098317e3d62aa2f9c86eedc8e
parent9cb3a952b4ceb3c33e8481250179023fdf5ceebb (diff)
views: prevent backtrace when no server is available
Define the timestamp in the codepath executed when no server is found active. Prevent the web to show a backtrace because the timestamp variable is used but not defined as it is only created when a server is found.
-rw-r--r--ogcp/views.py1
1 files changed, 1 insertions, 0 deletions
diff --git a/ogcp/views.py b/ogcp/views.py
index 32beb3e..b31d8dc 100644
--- a/ogcp/views.py
+++ b/ogcp/views.py
@@ -420,6 +420,7 @@ def index():
time_dict = {'now': now, 'boot': boot, 'start': start}
dashboard_servers[server_id]['time_dict'] = time_dict
else:
+ timestamp = datetime.datetime.today()
dashboard_servers[server.id] = {}
dashboard_servers[server.id]['online'] = False
dashboard_servers[server.id]['name'] = server.name