Fixes issue with accessing stripe page without access code.

This commit is contained in:
Christopher Neugebauer 2016-09-25 09:56:16 +10:00
parent fd5754e679
commit 7a7aa95874

View file

@ -57,7 +57,10 @@ def card(request, invoice_id, access_code=None):
if not inv.can_view(user=request.user, access_code=access_code):
raise Http404()
to_invoice = redirect("invoice", inv.invoice.id, access_code)
args = [inv.invoice.id]
if access_code:
args.append(access_code)
to_invoice = redirect("invoice", *args)
if inv.invoice.balance_due() <= 0:
return to_invoice