Skip to content

Commit

Permalink
Don't attempt to return users to non-existant transfer
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
mhagander committed Nov 27, 2023
1 parent 2fdbfb3 commit c53d8b2
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion postgresqleu/confreg/invoicehandler.py
Original file line number Diff line number Diff line change
Expand Up @@ -333,7 +333,10 @@ def get_return_url(self, invoice):
try:
pending = RegistrationTransferPending.objects.get(pk=invoice.processorid)
except RegistrationTransferPending.DoesNotExist:
raise Exception("Could not find pending transfer: %s!" % invoice.processorid)
# We can't find the transfer - that could be because it's successfully completed,
# at which point the reservation may be canceled. So in this case, we just redirect
# the user back to their invoice, because we have to send them somewhere.
return "{}/invoices/{}/".format(settings.SITEBASE, invoice.recipient_secret)

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

Expand Down

0 comments on commit c53d8b2

Please sign in to comment.