Commit dab8a4d0 authored by Aurel's avatar Aurel

use the right field key for the validator, thus required relation

field now works when all fields are validated


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@40355 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 4d0542ee
...@@ -124,14 +124,16 @@ class RelationStringFieldValidator( ...@@ -124,14 +124,16 @@ class RelationStringFieldValidator(
""" """
relation_item_id = field.generate_subfield_key(ITEM_ID, relation_item_id = field.generate_subfield_key(ITEM_ID,
key=key) key=key)
if isinstance(relation_uid_list, (list, tuple)): if isinstance(relation_uid_list, (list, tuple)):
try: try:
relation_uid_list = relation_uid_list[0] relation_uid_list = relation_uid_list[0]
except IndexError: except IndexError:
# No object was selected # No object was selected
return [] return []
relation_field_id = field.generate_subfield_key("%s" % \
SUB_FIELD_ID, key=key)
value = self.default_validator_instance.validate(field, value = self.default_validator_instance.validate(field,
key, REQUEST) relation_field_id, REQUEST)
return [(relation_item_id, relation_uid_list, value)] return [(relation_item_id, relation_uid_list, value)]
def _generateFieldValueList(self, field, key, def _generateFieldValueList(self, field, key,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment