Commit 29125bb2 authored by Romain Courteaud's avatar Romain Courteaud

[ERP5Form] Use Textarea validator for GadgetField

Needed to replace EditorField and handle the end of line characters in the same way
parent 8564183b
...@@ -54,9 +54,9 @@ class GadgetWidget(Widget.Widget): ...@@ -54,9 +54,9 @@ class GadgetWidget(Widget.Widget):
return [] return []
return result return result
class GadgetFieldValidator(Validator.Validator): class GadgetFieldValidator(Validator.TextValidator):
property_names = Validator.Validator.property_names + ['data_url'] property_names = Validator.TextValidator.property_names + ['data_url']
data_url = fields.CheckBoxField('data_url', data_url = fields.CheckBoxField('data_url',
title='Data Url', title='Data Url',
...@@ -65,7 +65,7 @@ class GadgetFieldValidator(Validator.Validator): ...@@ -65,7 +65,7 @@ class GadgetFieldValidator(Validator.Validator):
default=0) default=0)
def validate(self, field, key, REQUEST): def validate(self, field, key, REQUEST):
value = REQUEST.get(key, None) value = Validator.TextValidator.validate(self, field, key, REQUEST)
if value is not None: if value is not None:
if field.get_value('data_url'): if field.get_value('data_url'):
value=value.split(",")[1] value=value.split(",")[1]
......
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