diff --git a/graphql_api/types/owner/owner.py b/graphql_api/types/owner/owner.py index aa5726d5b3..7b83289c76 100644 --- a/graphql_api/types/owner/owner.py +++ b/graphql_api/types/owner/owner.py @@ -356,11 +356,9 @@ def resolve_ai_enabled_repos(owner: Owner, info) -> List[str] | None: current_owner = info.context["request"].current_owner queryset = Repository.objects.filter(author=owner).viewable_repos(current_owner) - # App is installed on all repos - if not ai_features_app_install.repository_service_ids: - return list(queryset.values_list("name", flat=True)) - - repo_names = queryset.filter( + if ai_features_app_install.repository_service_ids: + queryset = queryset.filter( service_id__in=ai_features_app_install.repository_service_ids - ).values_list("name", flat=True) - return list(repo_names) + ) + + return list(queryset.values_list("name", flat=True))