Esempio n. 1
0
def reset_request():
    if current_user.is_authenticated:
        return redirect(url_for('main.home'))
    form=RequestResetForm()
    if form.validate_on_submit():
        user= User.query.filter_by(email=form.email.data).first()
        send_reset_email(user)
        flash('email has been sent to reset password', 'info')
    return render_template('reset_request.html', title='Reset Password', form=form)
Esempio n. 2
0
def reset_request():
    # we want user to be logged out, if logged in, redirect to home page
    if current_user.is_authenticated:
        return redirect(url_for('home'))
    form = RequestResetForm()
    if form.validate_on_submit():
        user = User.query.filter_by(email=form.email.data).first()
        send_reset_email(user)
        flash('An email has been sent with instructions to reset your password.', 'info')
        return redirect(url_for('users.login'))
    return render_template('reset_request.html', title='Reset Password', form=form)
Esempio n. 3
0
def reset_request():
    if current_user.is_authenticated:
        return redirect(url_for('main.index'))
    form = RequestResetForm()
    if form.validate_on_submit():
        user = User.query.filter_by(email=form.email.data).first()
        send_reset_email(user)
        flash(
            'An email has been sent with instructions to reset your password')
        return redirect(url_for('users.login'))
    return render_template('reset_request.html', form=form)
Esempio n. 4
0
def reset_request():
    if current_user.is_authenticated:
        return redirect(url_for("main.home"))
    form = RequestResetForm()
    if form.validate_on_submit():
        user = User.query.filter_by(email=form.email.data).first()
        send_reset_email(user)  # 发送邮件
        flash("邮件已发送", 'info')
        return redirect(url_for("users.login"))
    return render_template("reset_request.html",
                           title="Reset Password",
                           form=form)
def reset_request():
    if current_user.is_authenticated:
        return redirect(url_for('main.index'))
    form = RequestResetForm()
    if form.validate_on_submit():
        user = User.query.filter_by(email=form.email.data).first()
        send_reset_email(user)
        flash("Ti abbiamo inviato un'email per resettare la password", 'info')
        return redirect(url_for('users.login'))
    return render_template('reset_request.html',
                           title="Reset Password Request",
                           form=form)
Esempio n. 6
0
def reset_request():
    if current_user.is_authenticated:
        return redirect(url_for("main.home"))
    form = RequestResetForm()
    if form.validate_on_submit():
        user = User.query.filter_by(email=form.email.data).first()
        send_reset_email(user)
        flash("Email has been sent with instructions", category="info")
        return redirect(url_for("users.login"))
    return render_template("reset_request.html",
                           form=form,
                           title="Reset Password")
Esempio n. 7
0
def resetRequest():
    if current_user.is_authenticated:
        return redirect(url_for("main.home"))
    form = RequestResetForm()
    if form.validate_on_submit():
        user = User.query.filter_by(email=form.email.data).first()
        sendResetEmail(user)
        flash("A reset email has been sent to your email account.", "info")
        return redirect(url_for("users.login"))
    return render_template("resetRequest.html",
                           title="Reset Password",
                           form=form)
Esempio n. 8
0
def reset_request():
    if current_user.is_authenticated:
        return redirect(url_for('main.home'))
    form = RequestResetForm()
    if form.validate_on_submit():
        user = User.objects.get_or_404(email=form.email.data)
        send_reset_email(user)
        flash('Email have been sent with instructions to reset your password',
              'info')
        return redirect(url_for('users.login'))
    return render_template('reset_request.html',
                           form=form,
                           title='Reset Password Page')
Esempio n. 9
0
def request_reset():
    if current_user.is_authenticated:
        return redirect(url_for("main.home"))
    form = RequestResetForm()
    if form.validate_on_submit():
        user = User.query.filter_by(email=form.email.data).first()
        send_request_email(user)
        flash(
            "A link has been sent to your email,Kindly click that link to reset your password"
        )
        return redirect(url_for('users login'))
    return render_template("request_reset.html",
                           form=form,
                           legend="Reset Password")
Esempio n. 10
0
def reset_request():
    if current_user.is_authenticated:
        return redirect(url_for('main.home'))
    form = RequestResetForm()
    if form.validate_on_submit():
        user = User.query.filter_by(email=form.email.data).first()
        send_email(user)
        flash(
            'An email with further instructions has been sent to your email.',
            'primary')
        return redirect(url_for('users.login'))
    return render_template('reset_request.html',
                           title='Reset password',
                           form=form)