techwithtim / Flask-Web-App-Tutorial

Code for the note storing flask web app made during a YouTube video.
932 stars 1.03k forks source link

AttributeError: 'NoneType' object has no attribute 'encode' in if check_password_hash(user.password, password): #73

Open Jhomarie11 opened 2 years ago

Jhomarie11 commented 2 years ago

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')