예제 #1
0
def profile():
    form = UserProfileForm(obj=current_user)
    if form.validate_on_submit():
        form.updated_profile(current_user)
        flash('个人信息更新成功', 'success')
        return redirect(url_for('front.index'))
    return render_template('user/profile.html', form=form)
예제 #2
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)
예제 #3
0
파일: user.py 프로젝트: MingGeng/jobplus3-3
def user_profile():
    form = UserProfileForm(obj=current_user)
    if form.validate_on_submit():
        form.update_user(current_user)
        flash('更新用户信息成功', 'success')
        return redirect(url_for('user.user_profile'))
    return render_template('profile.html', form=form)
예제 #4
0
def profile():
    form = UserProfileForm(obj=current_user)
    if form.validate_on_submit():
        form.updated_profile(current_user)
        flash('信息更新成功', 'success')
        return redirect(url_for('user.user_detail'))
    return render_template('user/userprofile.html',form=form)
예제 #5
0
def edituser(user_id):
    user = User.query.get_or_404(user_id)
    form = UserProfileForm(obj=user, id=user.id)
    if form.validate_on_submit():
        form.Profile_update(user)
        flash('用户信息更新成功', 'success')
        return redirect(url_for('admin.users'))
    return render_template('admin/edit_user.html', form=form, user=user)
예제 #6
0
def profile():
    form = UserProfileForm(obj=current_user)
    if form.validate_on_submit():
        set_resume.save(form.resume.data, name=form.name_resume())
        form.updated_profile(current_user)
        flash('个人信息更新成功', 'success')
        return redirect(url_for('front.index'))
    return render_template('user/profile.html', form=form)
예제 #7
0
def userprofile():
    user = current_user
    form = UserProfileForm(obj=current_user)
    if form.validate_on_submit():
        form.update_user(current_user)
        flash('个人信息更新成功', 'success')
        return redirect(url_for('user.home_page', user_id=user.id))
    return render_template('user/userprofile.html', form=form)
예제 #8
0
파일: user.py 프로젝트: uranuday/jobplus7
def profile():

    form = UserProfileForm(obj=current_user)
    if form.validate_on_submit():
        form.update_user(current_user)
        return redirect(url_for("user.profile"))

    return render_template("user/profile.html", form=form)
예제 #9
0
def user_profile():
    user = User.query.filter_by(id=current_user.id).first()
    form = UserProfileForm(obj=user, id=user.id)
    if form.validate_on_submit():
        form.Profile_update(user)
        flash('您的个人资料修改成功!', 'success')
        return redirect(url_for('front.index'))
    return render_template('user/profile.html', form=form, user=user)
예제 #10
0
def profile():
    """
    个人信息配置
    """
    form = UserProfileForm(obj=current_user)
    if form.validate_on_submit():
        form.updated_profile(current_user)
        flash("个人信息更新成功", "success")
        return redirect(url_for("front.index"))
    return render_template("user/profile.html", form=form)
예제 #11
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)
예제 #12
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)
예제 #13
0
def profile():
    form = UserProfileForm(obj=current_user)
    #UserProfileForm 传入一个User对象,Form中显示相应数据
    #login_user后,创建了current_user,是一个User对象

    if form.validate_on_submit():
        form.updata_profile(current_user)
        #form.updata_profile,传入一个User对象,修改参数,上传给数据库
        flash('个人信息更新成功','success')
        return redirect(url_for('front.index'))
    return render_template('user/profile.html',form=form)
예제 #14
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)
예제 #15
0
def user_profile():
    user = User.query.filter_by(id=current_user.id).first()
    form = UserProfileForm(obj=user, id=user.id)
    if form.validate_on_submit():
        file = form.upload_resume_file.data
        if file:
            filename = secure_filename(file.filename)
            file.save(os.path.join('jobplus/static/', 'resume', filename))
            user.upload_resume_jobname = filename
            db.session.add(user)
            db.session.commit()
            print(filename)
        form.Profile_update(user)
        flash('您的个人资料修改成功!', 'success')
        return redirect(url_for('front.index'))
    return render_template('user/profile.html', form=form, user=user)