AttributeError: 'NoneType' object has no attribute 'email'. Flask-sqlalchemy
AttributeError: 'NoneType' object has no attribute 'email'. Flask-sqlalchemy
我有一个奇怪的问题...
我这样做:
if request.method=="POST":
email = request.form["email"]
session["email"] = email
found_user = users.query.filter_by(username=username).first()
found_user.email = email
db.session.commit()
给我这个问题:
found_user.email = email
AttributeError: 'NoneType' object has no attribute 'email'
谁能帮帮我??
谢谢 <3
这意味着它没有找到任何符合您的过滤器的用户
我有一个奇怪的问题...
我这样做:
if request.method=="POST":
email = request.form["email"]
session["email"] = email
found_user = users.query.filter_by(username=username).first()
found_user.email = email
db.session.commit()
给我这个问题:
found_user.email = email
AttributeError: 'NoneType' object has no attribute 'email'
谁能帮帮我?? 谢谢 <3
这意味着它没有找到任何符合您的过滤器的用户