diff --git a/pillar/api/custom_field_validation.py b/pillar/api/custom_field_validation.py index e86c7130..dc4a9a25 100644 --- a/pillar/api/custom_field_validation.py +++ b/pillar/api/custom_field_validation.py @@ -105,6 +105,9 @@ class ValidateCustomFields(Validator): val = v.validate(value) if val: + # This ensures the modifications made by v's coercion rules are + # visible to this validator's output. + self.current[field] = v.current return True log.warning('Error validating properties for node %s: %s', self.document, v.errors) diff --git a/tests/test_api/test_patch.py b/tests/test_api/test_patch.py index d39e82fe..2433fc79 100644 --- a/tests/test_api/test_patch.py +++ b/tests/test_api/test_patch.py @@ -187,14 +187,14 @@ class EditCommentTest(AbstractPatchCommentTest): json={'op': 'edit', 'content': 'Je moeder is niet je vader.'}, auth_token=token).json() self.assertEqual('
Je moeder is niet je vader.
\n', - res['properties']['content_html']) + res['properties']['_content_html']) # Get the node again, to inspect its changed state. patched_node = self.get(self.node_url, auth_token=token).json() self.assertEqual('Je moeder is niet je vader.', patched_node['properties']['content']) self.assertEqual('Je moeder is niet je vader.
\n', - patched_node['properties']['content_html']) + patched_node['properties']['_content_html']) self.assertNotEqual(pre_node['_etag'], patched_node['_etag']) def test_comment_edit_other_user_admin(self): @@ -214,7 +214,7 @@ class EditCommentTest(AbstractPatchCommentTest): self.assertEqual('Purrrr kittycat', patched_node['properties']['content']) self.assertEqual('Purrrr kittycat
\n', - patched_node['properties']['content_html']) + patched_node['properties']['_content_html']) def test_edit_noncomment_node(self): url = '/api/nodes/%s' % self.asset_id