Skip to content

Commit 5506f8d

Browse files
authored
fix: Fix item assign error dynamically. (#947)
1 parent 4bb55e8 commit 5506f8d

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

interactions/api/models/attrs_utils.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,16 @@ def __init__(self, kwargs_dict: dict = None, /, **other_kwargs):
5050
if value is not None and attrib.metadata.get("add_client"):
5151
if isinstance(value, list):
5252
for item in value:
53-
item["_client"] = client
53+
if isinstance(item, dict):
54+
item["_client"] = client
55+
elif isinstance(item, ClientSerializerMixin):
56+
item._client = client
57+
5458
else:
55-
value["_client"] = client
59+
if isinstance(value, dict):
60+
value["_client"] = client
61+
elif isinstance(value, ClientSerializerMixin):
62+
value._client = client
5663

5764
# make sure json is recursively handled
5865
if isinstance(value, list):

0 commit comments

Comments
 (0)