def companyregister(): form = CompanyRegisterForm() if form.validate_on_submit(): form.create_user() flash('注册成功,请登录!', 'success') return redirect(url_for('.login')) return render_template('companyregister.html', form=form)
def create_company(): form = CompanyRegisterForm() if form.validate_on_submit(): form.create_company flash('企业创建成功', 'success') return redirect(url_for('admin.users')) return render_template('admin/create_company.html', form=form)
def company_register(): form = CompanyRegisterForm() if form.validate_on_submit(): form.create_companyProfile() flash("Success!", 'success') return redirect(url_for('.login')) return render_template('company_register.html', form = form)
def company_register(): form = CompanyRegisterForm() if form.validate_on_submit(): form.create_company() flash('企业注册成功', 'success') return redirect(url_for('.company_register')) return render_template('company_register.html', form=form)
def company_register(): form = CompanyRegisterForm() if form.validate_on_submit(): user = form.create_user() user.role = User.ROLE_COMPANY db.session.add(user) db.session.commit() flash(u'企业注册成功', 'success') return redirect(url_for('front.index')) return render_template('company_register.html', form=form)
def company_register(): #公司注册 company_form = CompanyRegisterForm() user = User() role = user.ROLE_COMPANY if company_form.validate_on_submit(): company_form.create_company(role) flash('注册成功,请登录!', 'success') return redirect(url_for('.login')) return render_template('company_register.html', company_form=company_form)
def companyregister(): form = CompanyRegisterForm() if form.validate_on_submit(): enterprise_user = form.create_company() enterprise_user.role = User.ROLE_COMPANY db.session.add(enterprise_user) db.session.commit() flash('企业用户注册成功,请登录!', 'success') return redirect(url_for('.login')) return render_template('companyregister.html', form=form)
def companyregister(): """ 企业注册 """ form = CompanyRegisterForm() post_url = url_for("front.companyregister") if form.validate_on_submit(): form.create_user() flash('注册成功,请登录!', 'success') return redirect(url_for('.login')) return render_template('register.html', form=form, post_url=post_url, topic="企业注册")
def create_company(): """ 创建企业用户 """ form = CompanyRegisterForm() post_url = url_for("admin.create_company") if form.validate_on_submit(): form.create_user() flash("创建成功!", "success") return redirect(url_for("admin.manage_user")) return render_template("admin/create_user.html", form=form, post_url=post_url, topic="企业创建")
def register(): user = User() form = CompanyRegisterForm() role = user.ROLE_COMPANY if not current_user.is_authenticated: if form.validate_on_submit(): form.create_company(role) user = user.query.filter_by(username=form.username.data).first() login_user(user, True) return redirect(url_for('company.company_profile')) return render_template('company/register.html', form=form) else: return redirect(url_for('company.company_profile'))
def company_register(): form=CompanyRegisterForm() return render_template('company_register.html',form=form)
def register(): #包括用户注册和公司注册 # user_form=UserRegisterForm() company_form=CompanyRegisterForm()