fix boolean handling in json output

This commit is contained in:
Deadswitch
2020-10-30 11:25:39 -05:00
parent db6fb443d1
commit 80842aae98

View File

@@ -96,7 +96,7 @@ if __name__ == '__main__':
if theRow is None: if theRow is None:
return jsonify({'success':False, 'error':f"No entry found for topic _{topic}_"}) return jsonify({'success':False, 'error':f"No entry found for topic _{topic}_"})
return jsonify({'success':True, 'topic':topic, 'active':theRow[0], 'expiry':theRow[1].strftime("%Y-%m-%d %H:%M:%S"), 'lastSeen':theRow[5].strftime("%Y-%m-%d %H:%M:%S"),'isExpired':theRow[4],'email':theRow[2], 'isNotified':theRow[3]}) return jsonify({'success':True, 'topic':topic, 'active':bool(theRow[0]), 'expiry':theRow[1].strftime("%Y-%m-%d %H:%M:%S"), 'lastSeen':theRow[5].strftime("%Y-%m-%d %H:%M:%S"),'isExpired':bool(theRow[4]),'email':theRow[2], 'isNotified':bool(theRow[3])})
@app.route('/api/v1', methods=['PUT','POST']) @app.route('/api/v1', methods=['PUT','POST'])
def api_setRecord(): def api_setRecord():