Exemple #1
0
def report_edit(workspace, report):
    workflow = report.workflow()
    form = ExpenseReportForm(obj=report)
    return report_edit_internal(workspace, form, report, workflow)

    # All okay. Allow editing
    if form.validate_on_submit():
        form.populate_obj(report)
        db.session.commit()
        flash("Edited report '%s'." % report.title, 'success')
        return render_redirect(url_for('report', workspace=workspace.name, report=report.url_name), code=303)
    return render_form(form=form, title=u"Edit expense report",
        formid="report_edit", submit=u"Save",
        cancel_url=url_for('report', workspace=workspace.name, report=report.url_name))
Exemple #2
0
def report_edit(report):
    workflow = report.workflow()
    if not workflow.can_view():
        abort(403)
    if not workflow.can_edit():
        return render_template('baseframe/message.html',
            message=u"You cannot edit this report at this time.")
    form = ExpenseReportForm(obj=report)
    return report_edit_internal(form, report, workflow)

    # All okay. Allow editing
    if form.validate_on_submit():
        form.populate_obj(report)
        db.session.commit()
        flash("Edited report '%s'." % report.title, 'success')
        return render_redirect(url_for('report', id=report.id), code=303)
    return render_form(form=form, title=u"Edit expense report",
        formid="report_edit", submit=u"Save",
        cancel_url=url_for('report', id=report.id))
Exemple #3
0
def report_edit(workspace, report):
    workflow = report.workflow()
    form = ExpenseReportForm(obj=report)
    return report_edit_internal(workspace, form, report, workflow)

    # All okay. Allow editing
    if form.validate_on_submit():
        form.populate_obj(report)
        db.session.commit()
        flash("Edited report '%s'." % report.title, 'success')
        return render_redirect(url_for('report',
                                       workspace=workspace.name,
                                       report=report.url_name),
                               code=303)
    return render_form(form=form,
                       title=u"Edit expense report",
                       formid="report_edit",
                       submit=u"Save",
                       cancel_url=url_for('report',
                                          workspace=workspace.name,
                                          report=report.url_name))
Exemple #4
0
def report_edit(report):
    workflow = report.workflow()
    if not workflow.can_view():
        abort(403)
    if not workflow.can_edit():
        return render_template(
            'baseframe/message.html',
            message=u"You cannot edit this report at this time.")
    form = ExpenseReportForm(obj=report)
    return report_edit_internal(form, report, workflow)

    # All okay. Allow editing
    if form.validate_on_submit():
        form.populate_obj(report)
        db.session.commit()
        flash("Edited report '%s'." % report.title, 'success')
        return render_redirect(url_for('report', id=report.id), code=303)
    return render_form(form=form,
                       title=u"Edit expense report",
                       formid="report_edit",
                       submit=u"Save",
                       cancel_url=url_for('report', id=report.id))