def activation_regenerate(id):
    account = Account.query.get(id)
    if None == account:
        abort(404)
    if account.is_activation_code_expired():
        account.generate_activation_code()
        db.session.commit()
    # We must another email, but for ease of development message is shown
    return generate_activation_message(account)
Beispiel #2
0
def activation_regenerate(id):
    account = Account.query.get(id)
    if None == account:
        abort(404)
    if account.is_activation_code_expired():
        account.generate_activation_code()
        db.session.commit()
    # We must another email, but for ease of development message is shown
    return generate_activation_message(account)
Beispiel #3
0
def register():
    form = RegisterForm(request.form)
    if request.method == 'POST':
        account = Account()
        if form.validate():
            form.populate_obj(account)
            db.session.add(account)
            db.session.commit()

            send_email(account.email, generate_activation_message(account))

            flash("You are registered successfully")
            return redirect(url_for("home"))

    return render_template('register.html', form=form)
def register():
    form = RegisterForm(request.form)
    if request.method == 'POST':
        account = Account()
        if form.validate():
            form.populate_obj(account)
            db.session.add(account)
            db.session.commit()

            send_email(account.email, generate_activation_message(account))

            flash("You are registered successfully")
            return redirect(url_for("home"))

    return render_template('register.html', form=form)
def activation_check(id):
    account = Account.query.get(id)
    if None == account:
        abort(404)
    return generate_activation_message(account)
Beispiel #6
0
def activation_check(id):
    account = Account.query.get(id)
    if None == account:
        abort(404)
    return generate_activation_message(account)