Beispiel #1
0
def profile():
    form = UserProfileForm(obj=current_user.resume)
    if form.validate_on_submit():
        form.update_resume(current_user)
        flash('简历更新成功', 'success')
        return redirect(url_for('front.index'))
    return render_template('user/profile.html', form=form)
Beispiel #2
0
def edituser(user_id):
    user = User.query.get_or_404(user_id)
    form = UserProfileForm(obj=user.resume)

    if form.validate_on_submit():
        form.update_resume(user)
        flash('简历更新成功', 'success')
        return redirect(url_for('admin.users'))
    return render_template('admin/edit_user.html', form=form, user=user)