2323from pydantic import BaseModel
2424from servicelib .fastapi .app_state import SingletonInAppStateMixin
2525from servicelib .logging_utils import log_context
26- from simcore_service_director_v2 .core .settings import get_application_settings
2726
2827from ...utils .db import get_repository
2928from ...utils .osparc_variables import (
@@ -180,6 +179,7 @@ async def resolve_and_substitute_session_variables_in_model(
180179 safe : bool = True ,
181180 user_id : UserID ,
182181 product_name : str ,
182+ product_api_base_url : str ,
183183 project_id : ProjectID ,
184184 node_id : NodeID ,
185185 service_run_id : ServiceRunID ,
@@ -194,7 +194,6 @@ async def resolve_and_substitute_session_variables_in_model(
194194 # if it raises an error vars need replacement
195195 raise_if_unresolved_osparc_variable_identifier_found (model )
196196 except UnresolvedOsparcVariableIdentifierError :
197- app_settings = get_application_settings (app )
198197 table = OsparcSessionVariablesTable .get_from_app_state (app )
199198 identifiers = await resolve_variables_from_context (
200199 table .copy (),
@@ -206,7 +205,7 @@ async def resolve_and_substitute_session_variables_in_model(
206205 node_id = node_id ,
207206 run_id = service_run_id ,
208207 wallet_id = wallet_id ,
209- api_server_base_url = app_settings . DIRECTOR_V2_PUBLIC_API_BASE_URL ,
208+ api_server_base_url = product_api_base_url ,
210209 ),
211210 )
212211 _logger .debug ("replacing with the identifiers=%s" , identifiers )
@@ -225,6 +224,7 @@ async def resolve_and_substitute_session_variables_in_specs(
225224 safe : bool = True ,
226225 user_id : UserID ,
227226 product_name : str ,
227+ product_api_base_url : str ,
228228 project_id : ProjectID ,
229229 node_id : NodeID ,
230230 service_run_id : ServiceRunID ,
@@ -241,7 +241,6 @@ async def resolve_and_substitute_session_variables_in_specs(
241241 identifiers_to_replace ,
242242 )
243243 if identifiers_to_replace :
244- app_settings = get_application_settings (app )
245244 environs = await resolve_variables_from_context (
246245 table .copy (include = identifiers_to_replace ),
247246 context = ContextDict (
@@ -252,7 +251,7 @@ async def resolve_and_substitute_session_variables_in_specs(
252251 node_id = node_id ,
253252 run_id = service_run_id ,
254253 wallet_id = wallet_id ,
255- api_server_base_url = app_settings . DIRECTOR_V2_PUBLIC_API_BASE_URL ,
254+ api_server_base_url = product_api_base_url ,
256255 ),
257256 )
258257
0 commit comments