techwithtim / Flask-Web-App-Tutorial

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

TypeError: object of type 'NoneType' has no len() #145

Open gousfraba opened 6 months ago

gousfraba commented 6 months ago

hi i m new to this. maybe its a noob question but i have this error and i cant find the way to fix it

line 51, in sign_up elif len(your_name) < 2: ^^^^^^^^^^^^^^^^^^^ TypeError: object of type 'NoneType' has no len()

why read it as None? what i must change to fix this?

gousfraba commented 6 months ago

hi again .i saw the video many times and i read all the issues and i check again all the code from start and finally i found this from : WJR1986 comment :

update this line: new_user = User(email=email, first_name=first_name, password=generate_password_hash(password1, method='sha256'))

to this line: new_user = User(email=email, first_name=first_name, password=generate_password_hash(password1, method='pbkdf2:sha256'))

now works perfect!