Example #1
0
def join():
    email = flask.request.form['email']
    team = flask.request.form['team']

    fiesta.add_member(email, team)

    return flask.redirect('/hero?%s' % (urllib.urlencode({"team": team})))
Example #2
0
def register():
    if request.method == "GET":
        return flask.render_template("register.html")

    email = request.form["email"]
    password = request.form["password"]
    confirmation = request.form["confirmation_password"]
    league_password = request.form["league_password"]

    if password != confirmation:
        return flask.render_template("register.html", error_msg="Your password did not match the confirmation")

    if league_password != settings.league_password:
        return flask.render_template("register.html", error_msg="Bad league password")

    session["email"] = email
    db.new_user(email, sha.sha(password).hexdigest(), email)
    if db.num_users() == 1:
        return redirect(
            "https://fiesta.cc/authorize?state=create_group&response_type=code&client_id=%s&_register_email=%s"
            % (settings.client_id, email)
        )
    else:
        fiesta.add_member(email)

    return redirect("/homepage")
Example #3
0
def register():
    if request.method == 'GET':
        return flask.render_template('register.html')

    email = request.form['email']
    password = request.form['password']
    confirmation = request.form['confirmation_password']
    league_password = request.form['league_password']

    if password != confirmation:
        return flask.render_template(
            'register.html',
            error_msg='Your password did not match the confirmation')

    if league_password != settings.league_password:
        return flask.render_template('register.html',
                                     error_msg='Bad league password')

    session['email'] = email
    db.new_user(email, sha.sha(password).hexdigest(), email)
    if db.num_users() == 1:
        return redirect(
            "https://fiesta.cc/authorize?state=create_group&response_type=code&client_id=%s&_register_email=%s"
            % (settings.client_id, email))
    else:
        fiesta.add_member(email)

    return redirect('/homepage')