diff options
Diffstat (limited to 'ogcp/views.py')
-rw-r--r-- | ogcp/views.py | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/ogcp/views.py b/ogcp/views.py index 1004aec..316f25c 100644 --- a/ogcp/views.py +++ b/ogcp/views.py @@ -1711,10 +1711,13 @@ def get_images_grouped_by_repos(): repo_id=image['repo_id'] repo_data={} if repo_id not in repos: - repo_name = [repo['name'] for repo in all_repos - if repo_id == repo['id']][0] + image_repo = [repo['name'] for repo in all_repos + if repo_id == repo['id']] repos[repo_id] = {} - repos[repo_id]['name'] = repo_name + if image_repo: + repos[repo_id]['name'] = image_repo[0] + else: + repos[repo_id]['name'] = 'unknown' repos[repo_id]['images'] = [image] else: repos[repo_id]['images'].append(image) |