Merge pull request #201 from akmiller01/master

Patch wagtail hooks to account for unpredictable dict internal table
This commit is contained in:
Diogo Marques 2018-04-17 16:20:46 +01:00 committed by GitHub
commit 77a86fb894
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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]