示例#1
0
def profile():
    if not current_user.is_company:
        flash('你不是企业用户', 'warning')
        redirect(url_for('front.index'))
    form = CompanyProfileForm(obj=current_user.company)
    if form.validate_on_submit():
        form.update_profile(current_user)  #企业信息配置表单里的更新函数送的是企业用户
        flash('企业信息更新成功', 'success')
        return redirect(url_for('front.index'))
    return render_template('company/profile.html', form=form)
示例#2
0
def profile():

    form = CompanyProfileForm(obj=current_user.company)
    action = 'company.profile'
    title = '编辑公司信息'

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

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