Skip to content

Commit

Permalink
Fix to get_schema(s) to use URL prefixed with slash for vapp.
Browse files Browse the repository at this point in the history
  • Loading branch information
dmichaels-harvard committed Sep 8, 2023
1 parent b079275 commit df706bf
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions dcicutils/ff_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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'
Expand Down

0 comments on commit df706bf

Please sign in to comment.