def get(self, session_id): s = Session.getSessionById(session_id) if (isinstance(s, Session)): response = s.toDict() response['result'] = True return jsonify(response) else: response = {} response['msg'] = s response['result'] = True return jsonify(response)
def delete(self, session_id): s = Session.getSessionById(session_id) if not (isinstance(s, Session)): response = {} response['msg'] = s response['result'] = False return jsonify(response) r = Session.deleteSessionById(session_id) if (r == False): response = {} response['msg'] = "Session Deletion Unsuccessful." response['result'] = False return jsonify(response) else: response = {} response['msg'] = "Session deleted successfully." response['result'] = True return jsonify(response)