Skip to content

Commit

Permalink
Fix Unicode issue with DecimalType
Browse files Browse the repository at this point in the history
  • Loading branch information
bintoro committed Nov 3, 2015
1 parent e86b4be commit befa202
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions schematics/types/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -537,7 +537,7 @@ class DecimalType(BaseType):
"""

MESSAGES = {
'number_coerce': "Number '{0}' failed to convert to a decimal.",
'number_coerce': u"Number '{0}' failed to convert to a decimal.",
'number_min': u"Value should be greater than {0}.",
'number_max': u"Value should be less than {0}.",
}
Expand All @@ -559,7 +559,6 @@ def to_native(self, value, context=None):
value = unicode(value)
try:
value = decimal.Decimal(value)

except (TypeError, decimal.InvalidOperation):
raise ConversionError(self.messages['number_coerce'].format(value))

Expand Down

0 comments on commit befa202

Please sign in to comment.