Change JSONEncoder: use Python's json module instead of Flask

This commit is contained in:
Emmanuel Viennet 2023-04-04 12:14:05 +02:00 committed by iziram
parent 59d10a01f7
commit 16149ea6bc

View File

@ -20,7 +20,8 @@ from flask import current_app, g, request
from flask import Flask
from flask import abort, flash, has_request_context, jsonify
from flask import render_template
from flask.json import JSONEncoder
# from flask.json import JSONEncoder
from flask.logging import default_handler
from flask_bootstrap import Bootstrap
@ -145,7 +146,7 @@ def handle_invalid_usage(error):
# JSON ENCODING
class ScoDocJSONEncoder(JSONEncoder):
class ScoDocJSONEncoder(json.JSONEncoder):
def default(self, o): # pylint: disable=E0202
if isinstance(o, (datetime.date, datetime.datetime)):
return o.isoformat()