summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJavier Sánchez Parra <jsanchez@soleta.eu>2022-08-22 16:04:52 +0200
committerJavier Sánchez Parra <jsanchez@soleta.eu>2022-08-31 15:57:52 +0200
commit88a01f018c80e175df41d22ebf0925ec17f1be13 (patch)
tree7027ed65d5352185d32cc3d66e24e35dc21e8969
parent29ab4abf0d9ee969801d190eac827dd85083ab74 (diff)
Fix selection of scopes with empty IPs list
This commit prevents ogcp from always mark as selected/checked scopes that have an empty IP list.
-rw-r--r--ogcp/views.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/ogcp/views.py b/ogcp/views.py
index fc52ce0..a60a8d6 100644
--- a/ogcp/views.py
+++ b/ogcp/views.py
@@ -176,7 +176,8 @@ def add_state_and_ips(scope, clients, ips):
scope['ip'] = []
for child in scope['scope']:
scope['ip'] += add_state_and_ips(child, clients, ips)
- scope['selected'] = set(scope['ip']).issubset(ips)
+ scope['selected'] = (len(scope['ip']) < 0 and
+ set(scope['ip']).issubset(ips))
return scope['ip']
def get_allowed_scopes(scopes, allowed_scopes):