Esempio n. 1
0
def before_request():
    if current_user.is_authenticated:
        current_user.ping()
        if not current_user.confirmed() \
                and request.endpoint[:5] != 'auth.' \
                and request.endpoint != 'static':
            return redirect(url_for('auth.unconfirmed'))
Esempio n. 2
0
def confirm(token):
    if current_user.confirmed:
        return redirect(url_for('main.home'))
    if current_user.confirmed(token):
        flash('You have confirmed your account, Thanks!')
    else:
        flash('the confirmation link has expired or is invalid')
    return redirect(url_for('main.home'))
Esempio n. 3
0
def before_request():
    if (
        current_user.is_authenticated()
        and not current_user.confirmed()
        and request.endpoint[:5] != "auth."
        and request.endpoint != "static"
    ):
        return redirect(url_for("auth.unconfirmed"))
Esempio n. 4
0
def confirm(token):
    if current_user.confirmed:
        return redirect(url_for('main.index'))
    if current_user.confirmed(token):
        flash('You have confirmed your account. Thanks!')
    else:
        flash('The confirmation link is invalid or has expired.')
    return redirect(url_for('main.index'))
Esempio n. 5
0
def confirm(token):
    if current_user.confirmed:
        return redirect(url_for('main.index'))
    if current_user.confirmed(token):
        flash('you have confirmed')
    else:
        flash('the confirmation link is invalid')
    return redirect(url_for('main.index'))
Esempio n. 6
0
def confirm(token):
    if current_user.confirmed:
        return redirect(url_for('main.index'))
    if current_user.confirmed(token):
        flash('You have comfirmed your acount. Thanks')
    else:
        flash('The confirmation link is invalid or has expired')
    return redirect(url_for('main.index'))
Esempio n. 7
0
def activate(token):
    if current_user.confirmed():
        return redirect(url_for('main.index'))
    if current_user.confirm(token):
        flash('激活成功')
    else:
        flash('激活失败')
        return redirect(url_for('main.index'))
Esempio n. 8
0
def confirm(token):
    if current_user.confirmed:
        return redirect(url_for('main.index'))
    if current_user.confirmed(token):
        db.session.commit()
        flash('你已确认邮件')
    else:
        flash('请先到邮箱确认邮件')
    return redirect('main.index')
Esempio n. 9
0
def confirm(token):
    if current_user.confirmed():
        return redirect(url_for('main.index'))
    if current_user.confirm_token(token):
        db.session.commit()
        flash('Congratulations! You have successfully confirmed your account')
    else:
        flash('Your confirmation link is expired')
    return redirect(url_for('main.index'))
Esempio n. 10
0
def confirm(token):
    if current_user.confirmed():
        return redirect(url_for('main.index'))
    if current_app.confirm(token):
        db.session.commit()
        flash('You have confirmed your account. Thanks!')
    else:
        flash('The confirmation link is invalid or has expired.')
    return redirect(url_for('main.index'))
Esempio n. 11
0
def confirm(token):
    print(current_user.confirm)
    if current_user.confirm:
        flash('You have already confirm')
        return redirect(url_for('main.index'))
    if current_user.confirmed(token):
        flash('Thanks for Confirming')
        return redirect(url_for('main.index'))
    flash('The confirm link is past due')
    return redirect(url_for('main.index'))
Esempio n. 12
0
def before_request():
    if current_user.is_authenticated:
        current_user.ping()
        if not current_user.confirmed() \
                and request.endpoint[:5] != 'auth.':
            return redirect(url_for('auth.unconfirmed'))