Ejemplo n.º 1
0
def profile():
    form = CompanyProfileForm(obj=current_user.company,
                              username=current_user.username,
                              email=current_user.email,
                              id=current_user.id)
    if form.validate_on_submit():
        form.Company_update(user)
        flash('公司资料修改成功!','success')
        return redirect(url_for('front.index'))
    return render_template('company/profile.html',form=form)
Ejemplo n.º 2
0
def editcompany(company_id):
    user = User.query.get_or_404(company_id)
    form = CompanyProfileForm(obj=user.company,
                              username=user.username,
                              email=user.email,
                              id=user.id)
    if form.validate_on_submit():
        form.Company_update(user)
        flash('企业更新成功', 'success')
        return redirect(url_for('admin.users'))
    return render_template('admin/edit_company.html', form=form, user=user)