diff --git a/wagtail_modeltranslation/wagtail_hooks.py b/wagtail_modeltranslation/wagtail_hooks.py index fa62dac..4703d72 100644 --- a/wagtail_modeltranslation/wagtail_hooks.py +++ b/wagtail_modeltranslation/wagtail_hooks.py @@ -59,13 +59,13 @@ def return_translation_target_field_rendered_html(request, page_id): # Patch field prefixes from origin field to target field target_field_patched = [] for item in origin_field_serialized: - patched_item = None + patched_item = {'name': None, 'value': None} for att in iteritems(item): target_value = att[1] if att[0] == 'name': target_value = att[1].replace( origin_field_name, target_field_name) - patched_item = {"name": target_value} + patched_item["name"] = target_value else: patched_item["value"] = att[1]