Ejemplo n.º 1
0
    def delete(self, id):
        """Delete the voucher

        GET will return a form asking for approval.

        POST requests will delete the item.
        """
        c.voucher = Voucher.find_by_id(id)
        return render('/voucher/confirm_delete.mako')
Ejemplo n.º 2
0
    def delete(self, id):
        """Delete the voucher

        GET will return a form asking for approval.

        POST requests will delete the item.
        """
        c.voucher = Voucher.find_by_id(id)
        return render('/voucher/confirm_delete.mako')
Ejemplo n.º 3
0
    def _delete(self, id):
        c.voucher = Voucher.find_by_id(id)

        if not c.voucher.registration:
            meta.Session.delete(c.voucher)
            meta.Session.commit()
            h.flash("Voucher has been deleted.")
        else:
            h.flash("Cannot delete a voucher which has already been used.", 'error')

        redirect_to('index')
Ejemplo n.º 4
0
    def _delete(self, id):
        c.voucher = Voucher.find_by_id(id)

        if not c.voucher.registration:
            meta.Session.delete(c.voucher)
            meta.Session.commit()
            h.flash("Voucher has been deleted.")
        else:
            h.flash("Cannot delete a voucher which has already been used.",
                    'error')

        redirect_to('index')