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-09-27 09:48:35 +0200
commit028f810a47b2c818a455e25e1319fe88e3cde8df (patch)
tree7176a25d98e637e06a341dfeeea74aaa35739823
parent229ad311bee9fea54f7fdad4d5b3a74ea173f004 (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):