JasperVanDenBosch / niprov

provenance for neuroimaging data
BSD 3-Clause "New" or "Revised" License
9 stars 0 forks source link

JsonFormat should skip ObjectId #160

Closed JasperVanDenBosch closed 8 years ago

JasperVanDenBosch commented 8 years ago
  File "/home/jasperb/Projects/niprov/niprov/templates/master.mako", line 44, in render_body
    ${self.body()}
  File "/home/jasperb/Projects/niprov/niprov/templates/pipeline.mako", line 7, in render_body
    <script>var files = ${request.dependencies.getSerializer().serializeList(pipeline.files) | n};</script>
  File "/home/jasperb/Projects/niprov/niprov/formatjson.py", line 56, in serializeList
    return json.dumps(flatRecords, cls=DateTimeAwareJSONEncoder)
  File "/usr/lib/python2.7/json/__init__.py", line 250, in dumps
    sort_keys=sort_keys, **kw).encode(obj)
  File "/usr/lib/python2.7/json/encoder.py", line 207, in encode
    chunks = self.iterencode(o, _one_shot=True)
  File "/usr/lib/python2.7/json/encoder.py", line 270, in iterencode
    return _iterencode(o, 0)
  File "/home/jasperb/Projects/niprov/niprov/formatjson.py", line 112, in default
    return json.JSONEncoder.default(self, obj)
  File "/usr/lib/python2.7/json/encoder.py", line 184, in default
    raise TypeError(repr(o) + " is not JSON serializable")
TypeError: ObjectId('56df2717fb481f666c746a09') is not JSON serializable