def profile(): form = CompanyProfileForm() if form.validate_on_submit(): form.update_company(current_user) flash('公司注册成功', 'success') return redirect(url_for('front.index')) return render_template('company/profile.html', form = form)
def profile(): form = CompanyProfileForm(obj=current_user.company) if form.validate_on_submit(): form.update_company(current_user.company) return redirect(url_for("company.profile")) else: return render_template("company/profile.html", form=form)
def companyprofile(): form = CompanyProfileForm(obj=current_user) form.name.data = current_user.username form.email.data = current_user.email if form.validate_on_submit(): form.update_company(current_user) flash('个人信息更新成功', 'success') return redirect(url_for('front.index')) return render_template('company/companyprofile.html', form=form)
def addcompany(user_id): user = User.query.get_or_404(user_id) form = CompanyProfileForm() if form.validate_on_submit(): form.update_company(user) flash('企业配置成功', 'success') return redirect(url_for('admin.users')) return render_template('admin/addcompany.html', form=form, user_id=user_id)
def profile(): if not current_user.is_company: flash('你不是企业用户', 'warning') return redirect(url_for('front.index')) form = CompanyProfileForm(obj=current_user.company) if form.validate_on_submit(): form.update_company(current_user) flash('企业信息更新成功', 'success') return redirect(url_for('front.index')) return render_template('company/profile.html', form=form)
def profile(): company = current_user.company if not company: form = CompanyProfileForm() else: form = CompanyProfileForm(obj=company) if form.validate_on_submit(): form.update_company(user=current_user, company=company) flash('公司注册成功', 'success') return redirect(url_for('front.index')) return render_template('company/profile.html', form=form)