From 8257ec492d4ce091d603fac154f5bc8c59815e18 Mon Sep 17 00:00:00 2001 From: Ian Renton Date: Mon, 30 Mar 2026 19:09:04 +0100 Subject: [PATCH] Trap NaN frequencies and return None instead --- data/spot.py | 4 ++++ templates/about.html | 2 +- templates/add_spot.html | 4 ++-- templates/alerts.html | 4 ++-- templates/bands.html | 6 +++--- templates/base.html | 8 ++++---- templates/conditions.html | 4 ++-- templates/map.html | 6 +++--- templates/spots.html | 6 +++--- templates/status.html | 4 ++-- 10 files changed, 26 insertions(+), 22 deletions(-) diff --git a/data/spot.py b/data/spot.py index 5c4630c..6ac57de 100644 --- a/data/spot.py +++ b/data/spot.py @@ -200,6 +200,10 @@ class Spot: if self.de_dxcc_id and not self.de_flag: self.de_flag = lookup_helper.get_flag_for_dxcc(self.de_dxcc_id) + # Remove NaNs in frequency + if freq and freq == float("nan"): + freq = None + # Band from frequency if self.freq and not self.band: band = infer_band_from_freq(self.freq) diff --git a/templates/about.html b/templates/about.html index 134871c..a42c104 100644 --- a/templates/about.html +++ b/templates/about.html @@ -67,7 +67,7 @@

This software is dedicated to the memory of Tom G1PJB, SK, a friend and colleague who sadly passed away around the time I started writing it in Autumn 2025. I was looking forward to showing it to you when it was done.

- + {% end %} \ No newline at end of file diff --git a/templates/add_spot.html b/templates/add_spot.html index 90dc3e2..68bb59f 100644 --- a/templates/add_spot.html +++ b/templates/add_spot.html @@ -69,8 +69,8 @@ - - + + {% end %} \ No newline at end of file diff --git a/templates/alerts.html b/templates/alerts.html index a96c1e1..6cfeebe 100644 --- a/templates/alerts.html +++ b/templates/alerts.html @@ -56,8 +56,8 @@ - - + + {% end %} \ No newline at end of file diff --git a/templates/bands.html b/templates/bands.html index 60b0d96..cb34572 100644 --- a/templates/bands.html +++ b/templates/bands.html @@ -62,9 +62,9 @@ - - - + + + {% end %} \ No newline at end of file diff --git a/templates/base.html b/templates/base.html index 59d0d18..454336b 100644 --- a/templates/base.html +++ b/templates/base.html @@ -46,10 +46,10 @@ crossorigin="anonymous"> - - - - + + + + diff --git a/templates/conditions.html b/templates/conditions.html index 730c789..ed31c96 100644 --- a/templates/conditions.html +++ b/templates/conditions.html @@ -189,8 +189,8 @@ - - + + {% end %} \ No newline at end of file diff --git a/templates/map.html b/templates/map.html index 966c37e..66cef5f 100644 --- a/templates/map.html +++ b/templates/map.html @@ -70,9 +70,9 @@ - - - + + + {% end %} \ No newline at end of file diff --git a/templates/spots.html b/templates/spots.html index cec290a..12e85ee 100644 --- a/templates/spots.html +++ b/templates/spots.html @@ -87,9 +87,9 @@ - - - + + + {% end %} \ No newline at end of file diff --git a/templates/status.html b/templates/status.html index f035959..229ff9e 100644 --- a/templates/status.html +++ b/templates/status.html @@ -59,8 +59,8 @@ - - + +