def add_to_beta_list(): email = request.form['email'] ip = request.form['ip'] browser = request.form['browser'] res = {'result': Manager.addBetaUser(email, ip, browser)} return jsonify(res)
def newUser(): user = request.form['user'] pwd = request.form['pwd'] code = request.form['code'] email = request.form['email'] m = Manager() res = dict() if m.validateCode(code): u_id = User.create(user, email, pwd, code) if u_id: res = {'id': u_id} else: res = {'error': 'Username/email is already in use'} else: res = {'error': 'Code is not valid'} return jsonify(res)
def add_code(): key = request.form['k'] code = request.form['c'] if key == 'ivan': res = {'result': Manager.addCode(code)} return jsonify(res) else: abort(401)
def test_validate_code(self): code = 'TECHHUB' m = Manager() print m.getLogLevel() m.setLog(logging.DEBUG) if m.validateCode(code): print code + ' is a valid code ' else: print 'Sorry, ' + code + ' code is not valid' code2 = 'INC2' if m.validateCode(code2): print code2 + ' is a valid code ' else: print 'Sorry, ' + code2 + ' code is not valid'
def validate(code=None): return jsonify({'result': Manager.validateCode(code)})
def test_disable_code(self): m = Manager() m.disableCode('DISABLED')
def test_list(self): m = Manager() print m.listCodes()