From 67b047e7b30e0b10306b4723771a85cf5592a436 2016-04-24 21:20:41 From: Christopher Neugebauer Date: 2016-04-24 21:20:41 Subject: [PATCH] Simplifies invoice-getting documentation. --- diff --git a/docs/payments.rst b/docs/payments.rst index 51ff01dac8bc01fdbd5a8ecccba26b35509b4c23..3a2d6262c33b99ed414e0f9fa6b8536f947e3994 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.