Skip to content

Commit

Permalink
strip before consider setting missing value
Browse files Browse the repository at this point in the history
  • Loading branch information
tdesvenain committed Apr 22, 2014
1 parent 1b27fdb commit 0b612d2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/z3c/form/converter.py
Expand Up @@ -44,10 +44,10 @@ def toWidgetValue(self, value):

def toFieldValue(self, value):
"""See interfaces.IDataConverter"""
if isinstance(value, basestring):
value = value.strip()
if value == u'':
return self.field.missing_value
if value is not None:
value = value.strip()
return self.field.fromUnicode(value)

def __repr__(self):
Expand Down

0 comments on commit 0b612d2

Please sign in to comment.