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.
master
Alejandro Sirgo Rica 2024-05-27 10:35:10 +02:00
parent 9cb3a952b4
commit 1f18af1208
1 changed files with 1 additions and 0 deletions

View File

@ -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