From 9021ca31af86ef64362818e49c88f8533b14d11a Mon Sep 17 00:00:00 2001 From: tonjo Date: Fri, 9 Apr 2021 11:08:41 +0200 Subject: [PATCH 1/2] Avoid error when AllowedIps is not defined --- src/dashboard.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/dashboard.py b/src/dashboard.py index 3e0e180..483ce17 100644 --- a/src/dashboard.py +++ b/src/dashboard.py @@ -166,7 +166,7 @@ def get_conf_peers_data(config_name): # Get allowed ip for i in conf_peer_data["Peers"]: - db.update({"allowed_ip":i['AllowedIPs']}, peers.id == i["PublicKey"]) + db.update({"allowed_ip":i.get('AllowedIPs', None)}, peers.id == i["PublicKey"]) def getdb(config_name): get_conf_peers_data(config_name) From d5462df4da7db287886ad6a4a9989074d2b4f62a Mon Sep 17 00:00:00 2001 From: tonjo Date: Fri, 9 Apr 2021 11:15:25 +0200 Subject: [PATCH 2/2] Update dashboard.py --- src/dashboard.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/dashboard.py b/src/dashboard.py index 483ce17..2531070 100644 --- a/src/dashboard.py +++ b/src/dashboard.py @@ -166,7 +166,7 @@ def get_conf_peers_data(config_name): # Get allowed ip for i in conf_peer_data["Peers"]: - db.update({"allowed_ip":i.get('AllowedIPs', None)}, peers.id == i["PublicKey"]) + db.update({"allowed_ip":i.get('AllowedIPs', '(None)')}, peers.id == i["PublicKey"]) def getdb(config_name): get_conf_peers_data(config_name)