python3: small fixes for .items() usage
This commit is contained in:
parent
e5baa69194
commit
a7204b51b4
1 changed files with 4 additions and 4 deletions
|
|
@ -43,24 +43,24 @@ def integration_scope_choices(permissions):
|
|||
repo_choices = [
|
||||
('repo:%s' % repo_name, '/' + repo_name)
|
||||
for repo_name, repo_perm
|
||||
in permissions['repositories'].items()
|
||||
in list(permissions['repositories'].items())
|
||||
if repo_perm == 'repository.admin'
|
||||
]
|
||||
repogroup_choices = [
|
||||
('repogroup:%s' % repo_group_name, '/' + repo_group_name + '/ (child repos only)')
|
||||
for repo_group_name, repo_group_perm
|
||||
in permissions['repositories_groups'].items()
|
||||
in list(permissions['repositories_groups'].items())
|
||||
if repo_group_perm == 'group.admin'
|
||||
]
|
||||
repogroup_recursive_choices = [
|
||||
('repogroup-recursive:%s' % repo_group_name, '/' + repo_group_name + '/ (recursive)')
|
||||
for repo_group_name, repo_group_perm
|
||||
in permissions['repositories_groups'].items()
|
||||
in list(permissions['repositories_groups'].items())
|
||||
if repo_group_perm == 'group.admin'
|
||||
]
|
||||
result.extend(
|
||||
sorted(repogroup_recursive_choices + repogroup_choices + repo_choices,
|
||||
key=lambda (choice, label): choice.split(':', 1)[1]
|
||||
key=lambda choice_label: choice_label[0].split(':', 1)[1]
|
||||
)
|
||||
)
|
||||
return result
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue