Skip to content

Commit bdbdf63

Browse files
authored
Merge pull request #112 from JaviCerveraIngram/CPS-82-update_parameters
CPS-82 - Fix to update_parameters
2 parents 731bd81 + 2e51c28 commit bdbdf63

File tree

2 files changed

+4
-9
lines changed

2 files changed

+4
-9
lines changed

connect/resources/fulfillment_automation.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -179,12 +179,10 @@ def update_parameters(self, pk, params):
179179
:return: The server response.
180180
:rtype: str
181181
"""
182-
list_dict = []
183-
for _ in params:
184-
list_dict.append(_.__dict__ if isinstance(_, Param) else _)
182+
mapped_params = [p.json for p in params if isinstance(p, Param)]
185183
return self._api.put(
186184
path=pk,
187-
json={'asset': {'params': list_dict}},
185+
json={'asset': {'params': mapped_params}},
188186
)[0]
189187

190188
def _update_conversation_if_exists(self, conversation, request_id, obj):

connect/resources/tier_config_automation.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -119,11 +119,8 @@ def update_parameters(self, pk, params):
119119
:return: The server response.
120120
:rtype: str
121121
"""
122-
list_dict = []
123-
for _ in params:
124-
list_dict.append(_.__dict__ if isinstance(_, Param) else _)
125-
122+
mapped_params = [p.json for p in params if isinstance(p, Param)]
126123
return self._api.put(
127124
path=pk,
128-
json={'params': list_dict},
125+
json={'params': mapped_params},
129126
)[0]

0 commit comments

Comments
 (0)