Skip to content

Commit fb615ae

Browse files
committed
Deleted obsolete function: it has been replaced by flask.jsonify
1 parent 11637b0 commit fb615ae

File tree

1 file changed

+0
-23
lines changed

1 file changed

+0
-23
lines changed

main.py

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -19,29 +19,6 @@
1919
app = Flask(__name__)
2020
dbclient = ndb.Client()
2121

22-
def wrap_json(obj):
23-
"""This method helps send JSON to the client"""
24-
data = json.dumps(obj)
25-
cb = request.args.get('callback')
26-
if cb is None:
27-
cb = request.args.get('jsonp')
28-
29-
if cb is not None and cb != '':
30-
data = cb + '(' + data + ')'
31-
response = app.response_class(
32-
response=data,
33-
status=200,
34-
mimetype='application/javascript'
35-
)
36-
else:
37-
response = app.response_class(
38-
response=data,
39-
status=200,
40-
mimetype='application/json'
41-
)
42-
43-
return response
44-
4522

4623
def find_provider_and_service(id):
4724
providers = [n for n in settings.SERVICES if n['id'] == id]

0 commit comments

Comments
 (0)