Exemplo n.º 1
0
def login_organization(form):
    try:
        organization = Organization.authenticate(
            form.email.data,
            form.password.data
        )

        login_user(organization, remember=True)
    except:
        pass
Exemplo n.º 2
0
def organizations_apply():
    form = ApplyOrganizationForm()

    if request.method == 'POST':
        form.process(request.form)
        if form.validate():
            organization = Organization.new(
                form.name.data,
                form.email.data,
                form.password.data
            )

            organization.save()

    return render_template('organizations/apply.html',
                           form = form)
Exemplo n.º 3
0
def load_user(id):
    return Organization.get(Organization.id == id)