From 930d5357fe0ad23a05f2ac49b29c44bee860425f Mon Sep 17 00:00:00 2001 From: Ian Renton Date: Fri, 12 Jun 2026 07:18:46 +0100 Subject: [PATCH] Prevent "TOTA" in cluster comments being flagged as Toilets on the Air, as this is ambiguous --- data/spot.py | 12 ++++++-- templates/about.html | 2 +- templates/add_spot.html | 59 ++++++++++++++++++++++++++++++++------- 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, 78 insertions(+), 33 deletions(-) diff --git a/data/spot.py b/data/spot.py index e40f6cf..c666982 100644 --- a/data/spot.py +++ b/data/spot.py @@ -14,7 +14,6 @@ from core.constants import MODE_ALIASES from core.geo_utils import lat_lon_to_cq_zone, lat_lon_to_itu_zone from core.lookup_helper import lookup_helper, infer_band_from_freq, infer_mode_from_comment, \ infer_mode_from_frequency, infer_mode_type_from_mode -from data.lookup_credentials import LookupCredentials from core.sig_utils import populate_sig_ref_info, ANY_SIG_REGEX, get_ref_regex_for_sig from data.sig_ref import SIGRef @@ -252,9 +251,16 @@ class Spot: if self.comment: sig_matches = re.finditer(r"(^|\W)" + ANY_SIG_REGEX + r"($|\W)", self.comment, re.IGNORECASE) for sig_match in sig_matches: - # First of all, if we haven't got a SIG for this spot set yet, now we have. This covers things like cluster - # spots where the comment is just "POTA". + # See what SIG we think this is found_sig = sig_match.group(2).upper() + + # "TOTA" is now ambiguous, with Toilets and Towers both using it. If we have found "TOTA" in a comment, + # ignore it as we can't tell what it is. + if found_sig != "TOTA": + continue + + # Now, if we haven't got a SIG for this spot set yet, now we have. This covers things like cluster + # spots where the comment is just "POTA". if not self.sig: self.sig = found_sig diff --git a/templates/about.html b/templates/about.html index 6f60b8f..5b39f8d 100644 --- a/templates/about.html +++ b/templates/about.html @@ -69,7 +69,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 f3752b5..e25725c 100644 --- a/templates/add_spot.html +++ b/templates/add_spot.html @@ -1,13 +1,6 @@ {% extends "base.html" %} {% block content %} -
- -
-
@@ -60,6 +53,32 @@
+ + + +
@@ -69,8 +88,28 @@
- - + + + + + -{% end %} \ No newline at end of file +{% end %} diff --git a/templates/alerts.html b/templates/alerts.html index 7175443..8f25709 100644 --- a/templates/alerts.html +++ b/templates/alerts.html @@ -70,8 +70,8 @@
- - + + {% end %} \ No newline at end of file diff --git a/templates/bands.html b/templates/bands.html index ae5986d..85c0778 100644 --- a/templates/bands.html +++ b/templates/bands.html @@ -76,9 +76,9 @@ - - - + + + {% end %} \ No newline at end of file diff --git a/templates/base.html b/templates/base.html index da1f35c..cabb60e 100644 --- a/templates/base.html +++ b/templates/base.html @@ -1,6 +1,6 @@ {% extends "skeleton.html" %} {% block head_extra %} - + @@ -19,9 +19,9 @@ integrity="sha384-L1eE4eD41kpBIWe2I0eHy+GnEUC4RIpcvibVW2JCminuPlTl+2Bc528iPdVMg5Dn" crossorigin="anonymous"> - - - + + + {% end %} {% block body %}
diff --git a/templates/conditions.html b/templates/conditions.html index 891b7c5..b11d12e 100644 --- a/templates/conditions.html +++ b/templates/conditions.html @@ -284,8 +284,8 @@
- - + + diff --git a/templates/map.html b/templates/map.html index 7fc8628..47549bd 100644 --- a/templates/map.html +++ b/templates/map.html @@ -94,9 +94,9 @@ - - - + + + {% end %} \ No newline at end of file diff --git a/templates/spots.html b/templates/spots.html index 04e65c8..f53bb8e 100644 --- a/templates/spots.html +++ b/templates/spots.html @@ -104,9 +104,9 @@ - - - + + + {% end %} \ No newline at end of file diff --git a/templates/status.html b/templates/status.html index eb14006..c3bb263 100644 --- a/templates/status.html +++ b/templates/status.html @@ -59,8 +59,8 @@ - - + +