Skip to content

Commit c53d8b2

Browse files
committed
Don't attempt to return users to non-existant transfer
When a registration transfer invoice is completed, if they payment confirmation notification hits before the user clicks onwards, we can't find the transfer record because it's been removed. In this case, just redirect the user back to the invoice so they get something other than a crash.
1 parent 2fdbfb3 commit c53d8b2

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

postgresqleu/confreg/invoicehandler.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -333,7 +333,10 @@ def get_return_url(self, invoice):
333333
try:
334334
pending = RegistrationTransferPending.objects.get(pk=invoice.processorid)
335335
except RegistrationTransferPending.DoesNotExist:
336-
raise Exception("Could not find pending transfer: %s!" % invoice.processorid)
336+
# We can't find the transfer - that could be because it's successfully completed,
337+
# at which point the reservation may be canceled. So in this case, we just redirect
338+
# the user back to their invoice, because we have to send them somewhere.
339+
return "{}/invoices/{}/".format(settings.SITEBASE, invoice.recipient_secret)
337340

338341
return "{}/events/{}/".format(settings.SITEBASE, pending.conference.urlname)
339342

0 commit comments

Comments
 (0)