@home_routes.route('/password/reset', methods=('GET', 'POST'))
def password_reset_view():
 if (request.method == 'GET'):
  return render_template('gentelella/admin/login/password_reminder.html')
 if (request.method == 'POST'):
  email = request.form['email']
  user = DataGetter.get_user_by_email(email)
  if user:
   link = (request.host + url_for('.change_password_view', hash=user.reset_password))
   send_email_with_reset_password_hash(email, link)
   flash('Please go to the link sent to your email to reset your password')
  return redirect(url_for('.login_view'))

@ home_routes . route ( '/password/reset' , methods = ( 'GET' , 'POST' ) ) def password_reset_view ( ) : if ( request . method == 'GET' ) : return render_template ( 'gentelella/admin/login/password_reminder.html' ) if ( request . method == 'POST' ) : email = request . form [ 'email' ] user = DataGetter . get_user_by_email ( email ) if user : link = ( request . host + url_for ( '.change_password_view' , hash = user . reset_password ) ) send_email_with_reset_password_hash ( email , link ) flash ( 'Please go to the link sent to your email to reset your password' ) return redirect ( url_for ( '.login_view' ) )
password reset view .