Пример #1
0
def reset_request():
	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 to reset your Password!', 'info')
		return redirect(url_for('login'))
	return render_template('reset_request.html', title = 'Reset Password', form = form)
Пример #2
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(
            'An email has been sent with instructions to reset your password',
            'success')
        return redirect(url_for('main.home'))
    return render_template('reset_request.html',
                           title="Reset Password",
                           form=form)
Пример #3
0
def reset_request():
    if current_user.is_authenticated:
        return redirect(url_for("main.home"))
    posts = Post.query.all()
    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 on your password reset",
            "info")
        return redirect(url_for("users.login"))
    return render_template("reset_request.html",
                           title="Reset Password",
                           form=form,
                           posts=posts)