Skip to content

Commit 9280515

Browse files
committed
change back condition common field format
1 parent 2352b84 commit 9280515

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

automapper/mapper.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -220,10 +220,10 @@ def map(
220220
common_fields_mapping[target_obj_field] = source_field
221221

222222
if fields_mapping:
223-
for key, value in fields_mapping.items():
224-
common_fields_mapping[key] = (
225-
value # Merge, with fields_mapping having priority
226-
)
223+
common_fields_mapping = {
224+
**common_fields_mapping,
225+
**fields_mapping,
226+
} # merge two dict into one, fields_mapping has priority
227227

228228
return self._map_common(
229229
obj,

0 commit comments

Comments
 (0)