Exemple #1
0
def profile():
    form = UserProfileForm(obj=current_user)
    if form.validate_on_submit():
        form.update_profile(current_user)
        flash('update done','success')
        return redirect(url_for('front.index'))
    return render_template('user/profile.html',form=form)
Exemple #2
0
def profile():
    form = UserProfileForm(obj=current_user)
    if form.validate_on_submit():
        form.update_profile(current_user)
        flash('个人信息更新成功', 'success')
        return redirect(url_for('front.index'))
    return render_template('user/profile.html', form=form)
Exemple #3
0
def profile():
    form = UserProfileForm(current_user, obj=current_user)
    if form.validate_on_submit():
        #if not form.password.data:
        #    current_user.password = form.user.password
        form.update_profile(current_user)
        #db.session.add(current_user)
        #db.session.commit()
        flash('个人信息更新成功','success')
        return redirect(url_for('front.index'))
    return render_template('user/profile.html',form=form)
Exemple #4
0
def edituser(user_id):
    user = User.query.get_or_404(user_id)
    if not user.is_company:
        form = UserProfileForm(obj=user)
    else:
        form = CompanyProfileForm(obj=user.company)
    if form.validate_on_submit():
        form.update_profile(user)
        flash('更新信息成功', 'success')
        return redirect(url_for('admin.users'))
    return render_template('admin/edit_user.html', form=form, user=user)
Exemple #5
0
def profile():

    form = UserProfileForm(obj=current_user)
    action = 'user.profile'
    title = '编辑个人信息'

    if form.validate_on_submit():
        form.update_profile(current_user)
        flash('个人信息更新成功', 'success')
        return redirect(url_for('user.profile'))

    return render_template('justform.html',
                           form=form,
                           action=action,
                           title=title,
                           upload=True)