示例#1
0
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)
示例#2
0
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)
示例#3
0
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'))
示例#4
0
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)