3939from .. import _crud_api_create , _crud_api_read , _projects_service
4040from .._permalink_service import update_or_pop_permalink_in_project
4141from ..models import ProjectDict
42- from ..utils import get_project_unavailable_services , project_uses_available_services
42+ from ..utils import are_project_services_available , get_project_unavailable_services
4343from . import _rest_utils
4444from ._rest_exceptions import handle_plugin_requests_exceptions
4545from ._rest_schemas import (
5555 ProjectsSearchQueryParams ,
5656)
5757
58- # When the user requests a project with a repo, the working copy might differ from
59- # the repo project. A middleware in the meta module (if active) will resolve
60- # the working copy and redirect to the appropriate project entrypoint. Nonetheless, the
61- # response needs to refer to the uuid of the request and this is passed through this request key
62- RQ_REQUESTED_REPO_PROJECT_UUID_KEY = f"{ __name__ } .RQT_REQUESTED_REPO_PROJECT_UUID_KEY"
63-
6458_logger = logging .getLogger (__name__ )
6559
6660
@@ -277,10 +271,8 @@ async def get_project(request: web.Request):
277271 req_ctx = RequestContext .model_validate (request )
278272 path_params = parse_request_path_parameters_as (ProjectPathParams , request )
279273
280- user_available_services : list [dict ] = (
281- await catalog_service .get_services_for_user_in_product (
282- request .app , req_ctx .user_id , req_ctx .product_name , only_key_versions = True
283- )
274+ user_available_services = await catalog_service .list_user_services_with_versions (
275+ request .app , user_id = req_ctx .user_id , product_name = req_ctx .product_name
284276 )
285277
286278 project = await _projects_service .get_project_for_user (
@@ -290,7 +282,8 @@ async def get_project(request: web.Request):
290282 include_state = True ,
291283 include_trashed_by_primary_gid = True ,
292284 )
293- if not await project_uses_available_services (project , user_available_services ):
285+
286+ if not are_project_services_available (project , user_available_services ):
294287 unavilable_services = get_project_unavailable_services (
295288 project , user_available_services
296289 )
@@ -305,9 +298,6 @@ async def get_project(request: web.Request):
305298 )
306299 )
307300
308- if new_uuid := request .get (RQ_REQUESTED_REPO_PROJECT_UUID_KEY ):
309- project ["uuid" ] = new_uuid
310-
311301 # Adds permalink
312302 await update_or_pop_permalink_in_project (request , project )
313303
0 commit comments