Fix search in postgres

Stupid missing group_by again
This commit is contained in:
Joseph Schorr 2017-04-21 17:21:17 -04:00
parent 80b565cbed
commit e46e668cc5

View file

@ -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