def edit_profile():
form=EditProfileForm()
u=User()
if request.method == 'POST' and form.validate():
pwd=u.GetPassword(g.user)
if u.verify_password(form.oripassword.data):
email=form.email.data
aboutme=form.about_me.data
if form.password.data is not u'':
u.ChangePassword(g.user,form.password.data)
u.ChangeProfile(g.user,email,aboutme)
flash('??????')
return redirect(url_for('.user',username=g.user))
else:
flash('????????')
u.GetUserInfo(g.user)
form.email.data=u.email
form.about_me.data=u.aboutme
return render_template('edit_profile.html',form=form,u=u)
评论列表
文章目录