diff --git a/endpoints/api/repository_models_pre_oci.py b/endpoints/api/repository_models_pre_oci.py index ad150cbb4..693767c0e 100644 --- a/endpoints/api/repository_models_pre_oci.py +++ b/endpoints/api/repository_models_pre_oci.py @@ -11,8 +11,8 @@ MAX_DAYS_IN_3_MONTHS = 92 REPOS_PER_PAGE = 100 -def create_channel(channel, releases_channels_map): - releases_channels_map[channel.linked_tag_name].append(channel.name) +def _create_channel(channel, releases_channels_map): + releases_channels_map[channel.linked_tag.name].append(channel.name) return Channel(channel.name, channel.linked_tag.name, channel.linked_tag.lifetime_start) @@ -107,14 +107,14 @@ class PreOCIModel(RepositoryDataInterface): star_set = {starred.id for starred in starred_repos} return [ - RepositoryBaseElement(repo.namespace_user.username, repo.name, repo.id in star_set, - repo.visibility_id == model.repository.get_public_repo_visibility().id, - repo_kind, repo.description, repo.namespace_user.organization, - repo.namespace_user.removed_tag_expiration_s, - last_modified_map.get(repo.rid), - action_sum_map.get(repo.rid), last_modified, popularity, username) - for repo in repos - ], next_page_token + RepositoryBaseElement(repo.namespace_user.username, repo.name, repo.id in star_set, + repo.visibility_id == model.repository.get_public_repo_visibility().id, + repo_kind, repo.description, repo.namespace_user.organization, + repo.namespace_user.removed_tag_expiration_s, + last_modified_map.get(repo.rid), + action_sum_map.get(repo.rid), last_modified, popularity, username) + for repo in repos + ], next_page_token def repo_exists(self, namespace_name, repository_name): repo = model.repository.get_repository(namespace_name, repository_name) @@ -148,7 +148,7 @@ class PreOCIModel(RepositoryDataInterface): releases = oci_model.release.get_release_objs(repo) releases_channels_map = defaultdict(list) return ApplicationRepository( - base, [create_channel(channel, releases_channels_map) for channel in channels], [ + base, [_create_channel(channel, releases_channels_map) for channel in channels], [ Release(release.name, release.lifetime_start, releases_channels_map) for release in releases ])