diff --git a/ffmap/routertools.py b/ffmap/routertools.py index 97688ad..77b029d 100644 --- a/ffmap/routertools.py +++ b/ffmap/routertools.py @@ -91,8 +91,8 @@ def import_nodewatcher_xml(mysql, mac, xml): distance ASC LIMIT 1 """,(lat,lng,lat,),"name") - else: - router_update["hood"] = None + if not router_update["hood"]: + router_update["hood"] = "Default" if router_id: # statistics diff --git a/ffmap/stattools.py b/ffmap/stattools.py index a7f9e8b..21ab252 100644 --- a/ffmap/stattools.py +++ b/ffmap/stattools.py @@ -150,6 +150,9 @@ def record_hood_stats(mysql): clients = total_clients_hood(mysql) for hood in clients.keys(): + if not hood: + hood = "Default" + old = mysql.findone("SELECT time FROM stats_hood WHERE time = %s AND hood = %s LIMIT 1",(time,hood,)) if old: