예제 #1
0
파일: app.py 프로젝트: wljtcc/puppeteer
def catalog_submit(env):
    """Receives the submitted form data from the catalogs page and directs
       the users to the comparison page. Directs users back to the catalogs
       page if no form submission data is found.

    :param env: This parameter only directs the response page to the right
       environment. If this environment does not exist return the use to the
       catalogs page with the right environment.
    :type env: :obj:`string`
    """
    envs = environments()
    check_env(env, envs)

    if app.config['ENABLE_CATALOG']:
        form = CatalogForm(request.form)

        form.against.choices = [(form.against.data, form.against.data)]
        if form.validate_on_submit():
            compare = form.compare.data
            against = form.against.data
            return redirect(
                url_for('catalog_compare',
                        env=env,
                        compare=compare,
                        against=against))
        return redirect(url_for('catalogs', env=env))
    else:
        log.warn('Access to catalog interface disabled by administrator')
        abort(403)
예제 #2
0
파일: app.py 프로젝트: nikolaik/puppetboard
def catalog_submit(env):
    """Receives the submitted form data from the catalogs page and directs
       the users to the comparison page. Directs users back to the catalogs
       page if no form submission data is found.

    :param env: This parameter only directs the response page to the right
       environment. If this environment does not exist return the use to the
       catalogs page with the right environment.
    :type env: :obj:`string`
    """
    envs = environments()
    check_env(env, envs)

    if app.config["ENABLE_CATALOG"]:
        form = CatalogForm(request.form)

        form.against.choices = [(form.against.data, form.against.data)]
        if form.validate_on_submit():
            compare = form.compare.data
            against = form.against.data
            return redirect(url_for("catalog_compare", env=env, compare=compare, against=against))
        return redirect(url_for("catalogs", env=env))
    else:
        log.warn("Access to catalog interface disabled by administrator")
        abort(403)
예제 #3
0
def catalog_submit():
    """Receives the submitted form data from the catalogs page and directs
       the users to the comparison page. Directs users back to the catalogs
       page if no form submission data is found.
    """
    if app.config["ENABLE_CATALOG"]:
        form = CatalogForm(request.form)

        form.against.choices = [(form.against.data, form.against.data)]
        if form.validate_on_submit():
            compare = form.compare.data
            against = form.against.data
            return redirect(url_for("catalog_compare", compare=compare, against=against))
        return redirect(url_for("catalogs"))
    else:
        log.warn("Access to catalog interface disabled by administrator")
        abort(403)