Skip to content

Commit 64433d2

Browse files
committed
Progress
1 parent c8099e6 commit 64433d2

File tree

1 file changed

+15
-14
lines changed

1 file changed

+15
-14
lines changed

src/vws/vws.py

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -533,25 +533,26 @@ def update_target(
533533
already exists.
534534
~vws.exceptions.ProjectInactive: The project is inactive.
535535
"""
536-
if image is None:
537-
image_data_encoded = None
538-
else:
536+
data = {}
537+
538+
if name is not None:
539+
data['name'] = name
540+
541+
if width is not None:
542+
data['width'] = name
543+
544+
if image is not None:
539545
image_data = image.getvalue()
540546
image_data_encoded = base64.b64encode(image_data).decode('ascii')
547+
data['image'] = image_data_encoded
541548

542-
if application_metadata is None:
543-
metadata_encoded = None
544-
else:
549+
if active_flag is not None:
550+
data['active_flag'] = active_flag
551+
552+
if application_metadata is not None:
545553
metadata_encoded_str = base64.b64encode(application_metadata)
546554
metadata_encoded = metadata_encoded_str.decode('ascii')
547-
548-
data = {
549-
# 'name': name,
550-
# 'width': width,
551-
# 'image': image_data_encoded,
552-
# 'active_flag': active_flag,
553-
# 'application_metadata': metadata_encoded,
554-
}
555+
data['application_metadata'] = metadata_encoded
555556

556557
content = bytes(json.dumps(data), encoding='utf-8')
557558

0 commit comments

Comments
 (0)