From 93156311e2441f36c90072b06ed794e90e0ccbaa Mon Sep 17 00:00:00 2001 From: W1CDN Date: Sun, 9 Jul 2023 22:15:03 -0500 Subject: [PATCH] Fix bug. --- api_app.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/api_app.py b/api_app.py index b35ee05..7f64f08 100644 --- a/api_app.py +++ b/api_app.py @@ -124,9 +124,11 @@ def index(): #stations = select_all_stations(get_db_connection()) #print(url_for("static", filename="test.txt", _external=True)) stations = json.loads(requests.get(url_for("stations", _external=True)).text)['data'] + #stations = json.loads(requests.get("https://digi.w1cdn.net/aprs_api/stations").text)['data'] # Convert unix time to datetime on the fly because I'm lazy right now for station in stations: - station['last_heard'] = datetime.datetime.fromtimestamp(station['last_heard_unix']) + if station['last_heard_unix'] != None: + station['last_heard'] = datetime.datetime.fromtimestamp(station['last_heard_unix']) return render_template('index.html', station_call = config['Settings']['station_call'],