Commit 63031499 authored by Jérome Perrin's avatar Jérome Perrin

sql_browser: nowadays Decimal module is allowed in restricted environment

since be31425e
parent d2cb31b1
#from decimal import Decimal from decimal import Decimal
import datetime import datetime
import json import json
from DateTime import DateTime from DateTime import DateTime
...@@ -26,7 +26,7 @@ for line in data[1:]: ...@@ -26,7 +26,7 @@ for line in data[1:]:
v = v.ISO() v = v.ISO()
elif isinstance(v, datetime.datetime): elif isinstance(v, datetime.datetime):
v = v.isoformat() v = v.isoformat()
elif "Decimal" in repr(v): # XXX decimal is not allowed in restricted environment elif isinstance(v, Decimal):
v = float(v) v = float(v)
new_line.append(v) new_line.append(v)
new_data.append(new_line) new_data.append(new_line)
......
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