Skip to content

Commit

Permalink
fix issue get urn empty
Browse files Browse the repository at this point in the history
  • Loading branch information
chuongmep committed Sep 4, 2024
1 parent fbd4773 commit cc1f9ef
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion APSToolkitPython/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

setuptools.setup(
name="aps-toolkit",
version="0.9.8",
version="0.9.9",
author="chuong mep",
author_email="[email protected]",
description="A Toolkit Autodesk Platform Services for Python",
Expand Down
1 change: 0 additions & 1 deletion APSToolkitPython/src/aps_toolkit/AECDataModel.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ def execute_query_variables(self, query, variables):
'Content-Type': 'application/json'
}
response = requests.post(self.url, headers=headers, json={'query': query, 'variables': variables})
response.raise_for_status()
if response.status_code != 200:
raise Exception(f"Error: {response.content}")
return response.json()
3 changes: 2 additions & 1 deletion APSToolkitPython/src/aps_toolkit/BIM360.py
Original file line number Diff line number Diff line change
Expand Up @@ -420,7 +420,8 @@ def get_urn_item_version(self, project_id: str, item_id: str, version: str):
item_versions = response.json()
for item_version in item_versions['data']:
if str(item_version['attributes']['versionNumber']) == str(version):
return item_version['relationships']['derivatives']['data']['id']
if 'derivatives' in item_version['relationships']:
return item_version['relationships']['derivatives']['data']['id']
return None

def upload_file_item(self, project_id: str, folder_id: str, file_path: str):
Expand Down

0 comments on commit cc1f9ef

Please sign in to comment.