Flask-Web-App-Tutorial
Flask-Web-App-Tutorial copied to clipboard
AttributeError: 'NoneType' object has no attribute 'encode' in if check_password_hash(user.password, password):
email = request.form.get('email') password = request.form.get('password1')
user = User.query.filter_by(email=email).first()
if user:
if check_password_hash(user.password, password):
flash('Logged in successfully!', category='success')Open an interactive python shell in this frame
login_user(user, remember=True)
return redirect(url_for('views.home'))
else:
flash('Incorrect password, try again.', category='error')