diff options
author | Javier Sánchez Parra <jsanchez@soleta.eu> | 2022-08-22 16:04:52 +0200 |
---|---|---|
committer | Javier Sánchez Parra <jsanchez@soleta.eu> | 2022-08-31 15:57:52 +0200 |
commit | 88a01f018c80e175df41d22ebf0925ec17f1be13 (patch) | |
tree | 7027ed65d5352185d32cc3d66e24e35dc21e8969 /ogcp/views.py | |
parent | 29ab4abf0d9ee969801d190eac827dd85083ab74 (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.
Diffstat (limited to 'ogcp/views.py')
-rw-r--r-- | ogcp/views.py | 3 |
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): |