From df706bff012e5bfa06ee1ad1288cc7fef900536d Mon Sep 17 00:00:00 2001 From: David Michaels Date: Fri, 8 Sep 2023 13:35:19 -0400 Subject: [PATCH] Fix to get_schema(s) to use URL prefixed with slash for vapp. --- dcicutils/ff_utils.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/dcicutils/ff_utils.py b/dcicutils/ff_utils.py index 280bdc0df..cad9f4028 100644 --- a/dcicutils/ff_utils.py +++ b/dcicutils/ff_utils.py @@ -990,7 +990,7 @@ def get_schema(name, key=None, ff_env: Optional[str] = None, portal_env: Optiona base_url = f"profiles/{to_camel_case(name)}.json" add_on = 'frame=raw' if portal_vapp: - full_url = f"{base_url}?{add_on}" + full_url = f"/{base_url}?{add_on}" res = portal_vapp.get(full_url) return get_response_json(res) else: @@ -1022,7 +1022,7 @@ def get_schemas(key=None, ff_env: Optional[str] = None, *, allow_abstract: bool base_url = 'profiles/' add_on = 'frame=raw' if portal_vapp: - full_url = f"{base_url}?{add_on}" + full_url = f"/{base_url}?{add_on}" schemas: Dict[str, Dict] = portal_vapp.get(full_url) else: schemas: Dict[str, Dict] = get_metadata(obj_id=base_url, key=key, ff_env=portal_env, add_on=add_on) @@ -1488,6 +1488,7 @@ def get_response_json(res): it is not present. Used with the metadata functions. """ try: + # TODO: Fix for res being from vapp (webtest.response.TestRespons) call, using MockResponse ... res_json = res.json() except Exception: raise Exception('Cannot get json for request to %s. Status'