def flow_detail(flow_id):
    flow = Flow.query.get(flow_id)
    if flow:
        form = FlowForm(obj=flow)
        if form.validate_on_submit():
            flow.update(
                flow_name=form.data['flow_name'],
                is_archived=form.data['is_archived']
            )

            flash('Flow successfully updated', 'alert-success')
            return redirect(url_for('conductor.flow_detail', flow_id=flow.id))

        return render_template('conductor/flows/edit.html', form=form, flow=flow)
    abort(404)
def flow_detail(flow_id):
    """View/edit a flow's details

    :status 200: Render the flow edit template
    :status 302: Post changes to the a flow  using the submitted
        :py:class:`~purchasing.conductor.forms.FlowForm`, redirect back to
        the current flow's detail page if successful
    """
    flow = Flow.query.get(flow_id)
    if flow:
        form = FlowForm(obj=flow)
        if form.validate_on_submit():
            flow.update(flow_name=form.data["flow_name"], is_archived=form.data["is_archived"])

            flash("Flow successfully updated", "alert-success")
            return redirect(url_for("conductor.flow_detail", flow_id=flow.id))

        return render_template("conductor/flows/edit.html", form=form, flow=flow)
    abort(404)
Example #3
0
def flow_detail(flow_id):
    '''View/edit a flow's details

    :status 200: Render the flow edit template
    :status 302: Post changes to the a flow  using the submitted
        :py:class:`~purchasing.conductor.forms.FlowForm`, redirect back to
        the current flow's detail page if successful
    '''
    flow = Flow.query.get(flow_id)
    if flow:
        form = FlowForm(obj=flow)
        if form.validate_on_submit():
            flow.update(
                flow_name=form.data['flow_name'],
                is_archived=form.data['is_archived']
            )

            flash('Flow successfully updated', 'alert-success')
            return redirect(url_for('conductor.flow_detail', flow_id=flow.id))

        return render_template('conductor/flows/edit.html', form=form, flow=flow)
    abort(404)