From 51f9bcfacd8a3c86906fe4edc080ebf8f7817a3a Mon Sep 17 00:00:00 2001 From: Shawn Date: Wed, 20 May 2026 22:58:50 -0400 Subject: [PATCH] =?UTF-8?q?fix:=20reports=20page=20=E2=80=94=20add=20asset?= =?UTF-8?q?=20lat/lng=20to=20/api/visits=20for=20map=20button,=20fix=20nul?= =?UTF-8?q?l=20field=20guard=20in=20form=20error=20handler?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- server.py | 2 +- static/index.html | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/server.py b/server.py index 2594dc0..151367e 100644 --- a/server.py +++ b/server.py @@ -2611,7 +2611,7 @@ def list_visits( params.append(date_to + " 23:59:59") where = " AND ".join(conditions) - sql = """SELECT v.*, a.name AS asset_name, a.machine_id, + sql = """SELECT v.*, a.name AS asset_name, a.machine_id, a.latitude, a.longitude, u.username AS user_name FROM visits v LEFT JOIN assets a ON v.asset_id = a.id diff --git a/static/index.html b/static/index.html index 7b505e5..53c52c0 100644 --- a/static/index.html +++ b/static/index.html @@ -3927,7 +3927,7 @@ if (field) field.classList.add('error'); if (errEl) { errEl.textContent = '⚠️ ' + msg; errEl.classList.add('visible'); } // Mark parent section - const section = field.closest('.form-collapse-section'); + const section = field ? field.closest('.form-collapse-section') : null; if (section) { section.classList.add('has-error'); openFormSection(section.id); } }