diff --git a/core/sig_utils.py b/core/sig_utils.py index 2fd96b5..38c3b23 100644 --- a/core/sig_utils.py +++ b/core/sig_utils.py @@ -109,12 +109,13 @@ def populate_sig_ref_info(sig_ref): # the zeroest corner of the box, then "lat2" and "lng2" provide the other corner. We detect this # and provide a single lat/lon for the centre. Otherwise if we don't have these extra parameters, # just use the single point we have. - if "latitude" in data and "longitude" in data and "lat2" in data and "lng2" in data: + if data.get("latitude") is not None and data.get("longitude") is not None and data.get( + "lat2") is not None and data.get("lng2") is not None: sig_ref.latitude = (float(data["latitude"]) + float(data["lat2"])) / 2.0 sig_ref.longitude = (float(data["longitude"]) + float(data["lng2"])) / 2.0 else: - sig_ref.latitude = float(data["latitude"]) if "latitude" in data else None - sig_ref.longitude = float(data["longitude"]) if "longitude" in data else None + sig_ref.latitude = float(data["latitude"]) if data.get("latitude") is not None else None + sig_ref.longitude = float(data["longitude"]) if data.get("longitude") is not None else None elif not response.from_cache: logging.warning("Malformed response looking up %s ref %s via GMA", sig, ref_id) elif not response.from_cache: diff --git a/templates/add_spot.html b/templates/add_spot.html index 91cbe33..11867dc 100644 --- a/templates/add_spot.html +++ b/templates/add_spot.html @@ -76,7 +76,7 @@ - + diff --git a/templates/alerts.html b/templates/alerts.html index 61ba018..d8db687 100644 --- a/templates/alerts.html +++ b/templates/alerts.html @@ -75,7 +75,7 @@ - + diff --git a/templates/bands.html b/templates/bands.html index 4a3e712..f5d24b5 100644 --- a/templates/bands.html +++ b/templates/bands.html @@ -75,8 +75,8 @@ - - + + diff --git a/templates/base.html b/templates/base.html index 66bc487..c828934 100644 --- a/templates/base.html +++ b/templates/base.html @@ -1,6 +1,6 @@ {% extends "skeleton.html" %} {% block head_extra %} - + @@ -10,10 +10,10 @@ - - - - + + + + {% end %} {% block body %}
diff --git a/templates/conditions.html b/templates/conditions.html index 06b5f45..4fe2ef7 100644 --- a/templates/conditions.html +++ b/templates/conditions.html @@ -284,7 +284,7 @@
- + diff --git a/templates/map.html b/templates/map.html index 5eb5524..84d0d6f 100644 --- a/templates/map.html +++ b/templates/map.html @@ -108,8 +108,8 @@ - - + + diff --git a/templates/spots.html b/templates/spots.html index deeb2ee..3387b41 100644 --- a/templates/spots.html +++ b/templates/spots.html @@ -116,8 +116,8 @@ - - + + diff --git a/templates/status.html b/templates/status.html index a3e4e7f..813e227 100644 --- a/templates/status.html +++ b/templates/status.html @@ -59,7 +59,7 @@ - +