From 67b047e7b30e0b10306b4723771a85cf5592a436 Mon Sep 17 00:00:00 2001 From: Christopher Neugebauer Date: Mon, 25 Apr 2016 07:15:03 +1000 Subject: [PATCH] Simplifies invoice-getting documentation. --- docs/payments.rst | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/docs/payments.rst b/docs/payments.rst index 51ff01da..3a2d6262 100644 --- a/docs/payments.rst +++ b/docs/payments.rst @@ -32,10 +32,7 @@ Our the ``demopay`` view from the ``registrasion-demo`` project implements pre-v from registrasion.controllers.invoice import InvoiceController from django.core.exceptions import ValidationError - # Get the Registrasion Invoice model - inv = get_object_or_404(rego.Invoice.objects, pk=invoice_id) - - invoice = InvoiceController(inv) + invoice = InvoiceController.for_id_or_404(invoice.id) try: invoice.validate_allowed_to_pay() # Verify that we're allowed to do this.