Ejemplo n.º 1
0
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)
Ejemplo n.º 2
0
def add_company():
    form = CompanyRegisterForm()
    if form.validate_on_submit():
        form.create_user()
        flash('增加企业成功', 'success')
        return redirect(url_for('admin.users'))
    return render_template('admin/add_company.html', form=form)
Ejemplo n.º 3
0
def create_company():
    form = CompanyRegisterForm()
    form.username.label = u'企业名称'
    if form.validate_on_submit():
        form.create_user()
        flash('企业创建成功', 'success')
        return redirect(url_for('admin.users'))
    return render_template('admin/create_company.html', form=form)
Ejemplo n.º 4
0
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="企业注册")
Ejemplo n.º 5
0
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="企业创建")
Ejemplo n.º 6
0
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)