Fix search group_by clause for PG

This commit is contained in:
Antoine Legrand 2017-03-17 16:30:24 +01:00
parent f08e4921f2
commit 718aeeead8

View file

@ -406,7 +406,7 @@ def _get_sorted_matching_repositories(lookup_value, include_private=False):
.select(Repository, Namespace)
.join(Namespace, on=(Namespace.id == Repository.namespace_user))
.where(Repository.name.match(lookup_value) | Repository.description.match(lookup_value))
.group_by(Repository.id))
.group_by(Repository.id, Namespace.id))
if not include_private:
query = query.where(Repository.visibility == _basequery.get_public_repo_visibility())