From 028f810a47b2c818a455e25e1319fe88e3cde8df Mon Sep 17 00:00:00 2001 From: Javier Sánchez Parra Date: Mon, 22 Aug 2022 16:04:52 +0200 Subject: 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. --- ogcp/views.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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): -- cgit v1.2.3-18-g5258