Ejemplo n.º 1
0
def rpc_verification_email():
    """
    Checks the existence of the entered email
    :return: OK or ERROR
    """
    user = Users()
    if request.method == 'POST':
        if not user.verification_email(request.form['email']):
            return jsonify({"result": "ERROR"})

    return jsonify({"result": "OK"})
Ejemplo n.º 2
0
def api_registration():
    """
    Upon receipt of the data creates a user
    /api_registration?username=mynameIS&[email protected]&pass=0000&phone=380665551122
    :return: OK or ERROR
    """
    user = Users()
    more = {}

    if not user.verification_email(email = request.args.get("email")):
        return jsonify({"result": "ERROR"})
    if request.args.get("username") and request.args.get("email") and \
            request.args.get("pass")and request.args.get("phone"):
        for i in request.args:
            if i != "username" and i != "email" and i != "pass" and i != "phone":
                more[i] = request.args[i]
        more = pickle.dumps(more)
        login_user = user.add_user(metod='get', more = more)
        if login_user:
            return jsonify({"result": "OK"})

    return jsonify({"result": "ERROR"})