diff --git a/backend/models.py b/backend/models.py index bf3f32d..0b75631 100644 --- a/backend/models.py +++ b/backend/models.py @@ -94,4 +94,4 @@ class UserPreferences(Base): calibration_warning_days = Column(Integer, default=30) status_ok_threshold_hours = Column(Integer, default=12) status_pending_threshold_hours = Column(Integer, default=24) - updated_at = Column(DateTime, default=datetime.utcnow, onupdate=datetime.utcnow) \ No newline at end of file + updated_at = Column(DateTime, default=datetime.utcnow, onupdate=datetime.utcnow) diff --git a/backend/services/snapshot.py b/backend/services/snapshot.py index b8805f0..7c737b7 100644 --- a/backend/services/snapshot.py +++ b/backend/services/snapshot.py @@ -40,7 +40,6 @@ def emit_status_snapshot(): # --- Merge roster entries first --- for unit_id, r in roster.items(): e = emitters.get(unit_id) - if r.retired: # Retired units get separated later status = "Retired" @@ -60,12 +59,12 @@ def emit_status_snapshot(): age = "N/A" fname = "" - units[unit_id] = { - "id": unit_id, - "status": status, - "age": age, - "last": last_seen.isoformat() if last_seen else None, - "fname": fname, + units[unit_id] = { + "id": unit_id, + "status": status, + "age": age, + "last": last_seen.isoformat() if last_seen else None, + "fname": fname, "deployed": r.deployed, "note": r.note or "", "retired": r.retired, @@ -76,12 +75,12 @@ def emit_status_snapshot(): "deployed_with_modem_id": r.deployed_with_modem_id, "ip_address": r.ip_address, "phone_number": r.phone_number, - "hardware_model": r.hardware_model, - # Location for mapping - "location": r.location or "", - "address": r.address or "", - "coordinates": r.coordinates or "", - } + "hardware_model": r.hardware_model, + # Location for mapping + "location": r.location or "", + "address": r.address or "", + "coordinates": r.coordinates or "", + } # --- Add unexpected emitter-only units --- for unit_id, e in emitters.items():