Skip to content

Commit 7eff2a3

Browse files
progress
1 parent dd94cde commit 7eff2a3

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

linode_api4/objects/base.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -286,16 +286,16 @@ def save(self, force=True) -> bool:
286286
else:
287287
data = self._serialize()
288288

289+
# Hack to minimize PUT contents to the configured json_class_options schema
289290
for key, value in data.items():
290-
key_property = getattr(type(self).properties, key, None)
291-
if key_property is None:
291+
if value is None or key not in type(self).properties:
292292
continue
293293

294-
json_class = key_property.json_class
295-
if json_class is None:
294+
json_class_options = type(self).properties[key].json_class_options
295+
if json_class_options is None:
296296
continue
297297

298-
data[key] = json_class.from_json(value).dict
298+
data[key] = json_class_options.from_json(value).dict
299299

300300
resp = self._client.put(type(self).api_endpoint, model=self, data=data)
301301

0 commit comments

Comments
 (0)