Skip to content

Commit

Permalink
Merge pull request #201 from akmiller01/master
Browse files Browse the repository at this point in the history
Patch wagtail hooks to account for unpredictable dict internal table
  • Loading branch information
DiogoMarques29 authored Apr 17, 2018
2 parents a91a158 + 50d78a1 commit 77a86fb
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions wagtail_modeltranslation/wagtail_hooks.py
Original file line number Diff line number Diff line change
Expand Up @@ -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]

Expand Down

0 comments on commit 77a86fb

Please sign in to comment.