def reset(): form = ResetForm(request.form) if form.validate_on_submit(): user = User.query.filter_by(email=form.email.data).first() if user is not None: send_reset_email(user) flash( 'If an account was linked to the provided email address, an email with reset instructions has been sent. ' 'Please check your inbox.', 'success') form = ResetForm(None) return {'form': form}
def reset(): form = ResetForm(request.form) if form.validate_on_submit(): user = User.query.filter_by(email=form.email.data).first() if user is not None: send_reset_email(user) flash('If an account was linked to the provided email address, an email with reset instructions has been sent. ' 'Please check your inbox.', 'success') form = ResetForm(None) return { 'form': form }