From ff270697d53282b4884b7ca248814e201492a348 Mon Sep 17 00:00:00 2001 From: Leo Date: Tue, 2 Jun 2026 22:56:09 -0400 Subject: [PATCH] =?UTF-8?q?fix:=20GPS=20only=20from=20real=20check-ins=20?= =?UTF-8?q?=E2=80=94=20never=20from=20Cantaloupe=20import?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit GPS coordinates from Cantaloupe are address-geocoded estimates, not real field data. Both UPDATE and INSERT paths now set latitude/longitude to None — GPS comes exclusively from tech check-ins via the main app. --- cantaloupe_sync.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/cantaloupe_sync.py b/cantaloupe_sync.py index 5749691..e1dc3b7 100644 --- a/cantaloupe_sync.py +++ b/cantaloupe_sync.py @@ -869,8 +869,8 @@ def approve_batch( if val is not None and str(val).strip() != "": updates[db_col] = str(val).strip() - # Handle numeric fields - for num_field in ("latitude", "longitude", "geofence_radius_meters"): + # Handle numeric fields (exclude GPS — comes only from real check-ins) + for num_field in ("geofence_radius_meters",): val = item.get(num_field) if val is not None and str(val).strip() != "": try: @@ -948,8 +948,8 @@ def approve_batch( cust_id, loc_id, 1 if cust_name and cust_name.startswith("D-") else 0, - _safe_float(item.get("latitude")), - _safe_float(item.get("longitude")), + None, # GPS only from real check-ins + None, # GPS only from real check-ins _safe_int(item.get("geofence_radius_meters"), 50), str(item.get("dex_report_date", "")).strip() or "", str(item.get("deployed", "")).strip() or "",