forked from ScoDoc/ScoDoc
Change JSONEncoder: use Python's json module instead of Flask
This commit is contained in:
parent
59d10a01f7
commit
16149ea6bc
@ -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()
|
||||
|
Loading…
Reference in New Issue
Block a user