Use flask.jsonify as we get it for free
parent
2a6c158f7c
commit
14aaedb284
|
@ -4,7 +4,7 @@
|
|||
# Warsaw Hackerspace SpaceAPI service implementation
|
||||
# 2013 Piotr 'inf' Dobrowolski <informatic@hackerspace.pl>
|
||||
|
||||
from flask import Flask
|
||||
from flask import Flask, jsonify
|
||||
import json
|
||||
import urllib2
|
||||
import traceback
|
||||
|
@ -79,7 +79,7 @@ def api_index():
|
|||
result['open'] = result['state']['open']
|
||||
result['icon'] = result['state']['icon']
|
||||
|
||||
return json.dumps(result)
|
||||
return jsonify(result)
|
||||
|
||||
if __name__ == '__main__':
|
||||
app.run(debug=True)
|
||||
|
|
Loading…
Reference in New Issue