File tree Expand file tree Collapse file tree 1 file changed +14
-4
lines changed
src/commercetools/testing Expand file tree Collapse file tree 1 file changed +14
-4
lines changed Original file line number Diff line number Diff line change @@ -72,12 +72,22 @@ def updater(
7272 ):
7373 new = copy .deepcopy (obj )
7474
75+ def update_attribute_type (type_info : dict ):
76+ if type_info ["name" ] == "lenum" :
77+ for value in type_info ["values" ]:
78+ if value ["key" ] == action .new_value .key :
79+ value ["label" ] = action .new_value .label
80+ return new
81+
82+ if type_info ["name" ] == "set" :
83+ return update_attribute_type (type_info ["elementType" ])
84+
85+
7586 for attribute in new ["attributes" ]:
7687 if attribute ["name" ] == action .attribute_name :
77- for lenum_value in attribute ["type" ]["values" ]:
78- if lenum_value ["key" ] == action .new_value .key :
79- lenum_value ["label" ] = action .new_value .label
80- return new
88+ result = update_attribute_type (attribute ["type" ])
89+ if result is not None :
90+ return result
8191
8292 raise InternalUpdateError (
8393 "No attribute found with name %r"
You can’t perform that action at this time.
0 commit comments