diff --git a/data/model/repository.py b/data/model/repository.py index bf14dc97e..dcd624a3d 100644 --- a/data/model/repository.py +++ b/data/model/repository.py @@ -105,7 +105,7 @@ def purge_repository(namespace_name, repository_name): return False fetched.delete_instance(recursive=True, delete_nullable=False) - + # Run callbacks for callback in config.repo_cleanup_callbacks: callback(namespace_name, repository_name) @@ -279,8 +279,8 @@ def unstar_repository(user, repository): .execute()) except Star.DoesNotExist: raise DataModelException('Star not found.') - - + + def set_trust(repo, trust_enabled): repo.trust_enabled = trust_enabled repo.save() @@ -481,6 +481,7 @@ def _get_sorted_matching_repositories(lookup_value, repo_kind='image', include_p query = (query .switch(Repository) .join(RepositorySearchScore) + .group_by(Repository, Namespace, RepositorySearchScore) .order_by(RepositorySearchScore.score.desc())) return query