Skip to content

Commit 11415fa

Browse files
committed
artifacts: omit blueprint when value is None
When a blueprintId is not supplied, the key should be omitted from the json passed as the request body. Signed-off-by: Mike Szczys <[email protected]>
1 parent af60de8 commit 11415fa

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

golioth/golioth.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -780,9 +780,11 @@ async def upload(self,
780780
'content': b64encode(path.open('rb').read()).decode(),
781781
'version': version,
782782
'package': package,
783-
'blueprintId': blueprint_id
784783
}
785784

785+
if blueprint_id is not None:
786+
json['blueprintId'] = blueprint_id
787+
786788
try:
787789
response = await self.project.client.post('artifacts', json=json)
788790
except httpx.HTTPStatusError as err:

0 commit comments

Comments
 (0)