fix boolean handling in json output
This commit is contained in:
2
api1.py
2
api1.py
@@ -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():
|
||||||
|
|||||||
Reference in New Issue
Block a user