Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace make_response with jsonify #4160

Open
wants to merge 3 commits into
base: dev
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions source/jormungandr/jormungandr/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
from __future__ import absolute_import, print_function, unicode_literals, division
import importlib
from flask_restful.representations import json
from flask import request, make_response, abort
from flask import request, jsonify, abort
from jormungandr import rest_api, app, i_manager
from jormungandr.index import index
from jormungandr.modules_loader import ModulesLoader
Expand All @@ -59,7 +59,8 @@ def output_jsonp(data, code, headers=None):
@rest_api.representation("text/json")
@rest_api.representation("application/json")
def output_json(data, code, headers=None):
resp = make_response(ujson.dumps(data), code)
resp = jsonify(data)
resp.status_code = code
resp.headers.extend(headers or {})
return resp

Expand Down
Loading