def profile(): form = CompanyProfileForm(obj=current_user.company) if form.validate_on_submit(): form.update_prorfile(current_user.company) flash('更新企业信息成功', 'success') return redirect(url_for('company.profile')) return render_template('profile.html', form=form)
def profile(): form = CompanyProfileForm(obj=current_user) 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)
def edit_company(user_id): company = Company.query.filter_by(user_id=user_id).first() form = CompanyProfileForm(obj=company) if form.validate_on_submit(): form.edit_company(company) flash('企业配置更新成功', 'success') return redirect(url_for('admin.users')) return render_template('admin/addcompany.html', form=form, cid=company.id)
def edit_profile(): company = current_user.company_info form = CompanyProfileForm(obj=company) if form.is_submitted(): form.update_profile(company) flash('更新成功', 'success') return redirect(url_for('company.company_detail', company_id=company.id)) return render_template('company/edit_profile.html', form=form)
def profile(company_id): company = Company.query.get_or_404(company_id) form = CompanyProfileForm(obj=company) if form.validate_on_submit(): form.save(company) flash('保存成功', 'success') return redirect(url_for('user.index')) return render_template('company/edit.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 company_profile(): form = CompanyProfileForm() del form.name if form.validate_on_submit(): form.add_company_profile(current_user.id, current_user.username) flash('企业用户注册成功!','success') return redirect(url_for('front.index')) return render_template('company/profile.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 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 profile(): form = CompanyProfileForm(obj=current_user.company) form.name.data = current_user.username form.email.data = current_user.email if form.validate_on_submit(): form.updated_profile(current_user) flash("企业信息更新成功", "success") return redirect(url_for("front.index")) return render_template('company/profile.html', form=form)
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)
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)
def updatecompany(cid): company = Company.query.get_or_404(cid) form = CompanyProfileForm(obj=company) if form.validate_on_submit(): form.edit_company(company) flash('企业配置更新成功', 'success') return redirect(url_for('admin.companies')) return render_template('admin/addcompany.html', form=form, cid=cid)
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)
def profile(): if not current_user.is_company: flash('您不是企业用户', 'warning') return redirect(url_for('front.index')) form = CompanyProfileForm(obj=current_user.company_detail) form.name.data = current_user.name form.email.data = current_user.email if form.validate_on_submit(): form.updated_profile(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) 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)
def profile(): form = CompanyProfileForm(obj=current_user.company_detail) form.username.data = current_user.username form.email.data = current_user.email if current_user.company_detail is not None: form.slug.data = current_user.company_detail.slug form.site.data = current_user.company_detail.site form.logo.data = current_user.company_detail.logo form.description.data = current_user.company_detail.description form.about.data = current_user.company_detail.about if form.validate_on_submit(): form.updated_profile(current_user) flash('企业信息更新成功', 'success') return redirect(url_for('company.profile')) return render_template('/company/profile.html', form=form)
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)
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)
def profile(): companyObject = getCurrentUser() if not companyObject.is_company: flash('你不是企业用户', 'warning') return redirect(url_for('front.index')) form: CompanyProfileForm = CompanyProfileForm(obj=companyObject.detail) form.name.data = companyObject.name form.email.data = companyObject.email form.phone.data = companyObject.phone if form.validate_on_submit(): form.updated_profile(companyObject) flash('企业信息更新成功', 'success') return redirect(url_for('front.index')) return render_template('company/profile.html', form=form)
def edit_user(user_id): user = User.query.get_or_404(user_id) if user.is_company: form = CompanyProfileForm(obj=user) else: form = UserProfileForm(obj=user) if form.validate_on_submit(): form.update(user) flash('更新成功', 'success') return redirect(url_for('admin.users')) if user.is_company: form.site.data = user.detail.site form.description.data = user.detail.description return render_template('admin/edit_user.html', form=form, user=user)
def edit_user(): """ 更新用户 """ user_id = request.args.get("user_id", "") user = User.query.get_or_404(user_id) if not user.is_admin: if user.is_company: company = Company.query.filter(Company.user == user).first() company.name = user.username company.email = user.email form = CompanyProfileForm(obj=company) if user.is_everyone: form = UserProfileForm(obj=user) if form.validate_on_submit(): form.updated_profile(user) flash("信息更新成功", "success") return redirect(url_for("admin.manage_user")) return render_template("admin/edit_user.html", form=form, user=user)
def profile(): form = CompanyProfileForm(obj=current_user) return render_template('company/profile.html', form=form)