def send_password_reset_request(): form = PasswordResetRequestForm() if form.validate_on_submit(): email = form.email.data user = User.query.filter_by(email=email).first() token = user.generate_reset_password_token() send_reset_password_mail(user, token) flash('Password reset request mail is sent, please check your mailbox', category='info') return render_template('send_password_reset_request.html', form=form)
def send_password_reset_request(): if current_user.is_authenticated: return redirect(url_for('index')) form = PasswordResetRequestForm() if form.validate_on_submit(): email = form.email.data user = User.query.filter_by(email=email).first() token = user.generate_reset_password_token() send_reset_password_mail(user, token) flash('Password reset request mail is sent, please check your email', category='info') return render_template('send_password_reset_request.html', form=form)
def send_password_reset_request(): if current_user.is_authenticated: return redirect(url_for('index')) form = PasswordResetRequestFrom() if form.validate_on_submit(): email = form.email.data user = User.query.filter_by(email=email).first() token = user.generate_reset_password_token() send_reset_password_mail(user, token) flash('Email has been successfully send to you account.', category='success') return render_template('send_password_reset_request.html', form=form)