Example #1
0
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)
Example #2
0
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)
Example #3
0
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)
Example #4
0
	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'
Example #5
0
def validate(code=None):
    return jsonify({'result': Manager.validateCode(code)})
Example #6
0
	def test_disable_code(self):
		m = Manager()
		m.disableCode('DISABLED')
Example #7
0
	def test_list(self):
		m = Manager()
		print m.listCodes()