fix json encoding by encoding bytes as ascii

This commit is contained in:
Mark Riedesel 2017-01-07 17:00:29 -06:00
parent 9320c68961
commit 078273f49f

View file

@ -101,6 +101,9 @@ def json_dumps(records):
if hasattr(o, 'toJSON') and isinstance(getattr(o, 'toJSON'), collections.Callable):
return o.toJSON()
if type(o) is bytes:
return o.decode('ascii')
elif isinstance(o, decimal.Decimal):
return str(o.quantize(decimal.Decimal('0.01')))