mirror of https://git.48k.eu/ogcp
views: fix user scope filtering
Create a copy of the array with scope references before the iteration and modification of the scopes dictionary. Prevent skipping values after deleting an element during the scope iteration.master
parent
5cbb4a7562
commit
471cb78676
|
@ -251,7 +251,8 @@ def add_state_and_ips(scope, clients, ips):
|
|||
return scope['ip']
|
||||
|
||||
def remove_disabled_scopes(scopes):
|
||||
for scope in scopes.get('scope'):
|
||||
scope_list = scopes.get('scope')[:]
|
||||
for scope in scope_list:
|
||||
if scope.get('type') == 'center':
|
||||
if str(scope.get('id')) in current_user.scopes:
|
||||
continue
|
||||
|
|
Loading…
Reference in New Issue