Use select for update before creating invoice for conference registration
authorMagnus Hagander <magnus@hagander.net>
Tue, 5 Nov 2024 12:41:31 +0000 (13:41 +0100)
committerMagnus Hagander <magnus@hagander.net>
Tue, 5 Nov 2024 12:41:31 +0000 (13:41 +0100)
commit39cbdeb03fdbc6acdae35deae24b5c738c28ba95
treea1bacc65d7e5dc106cb8044d4b4312c18fae2763
parent58dd9a71d75483300bee180f343ba3caf1b0baba
Use select for update before creating invoice for conference registration

Do this only for POSTs, but without that if the user clicks the confirm
button twice in a row Really Fast, there's a race condition whereby two
invoices can be created for the same registration, which is not
supported elsewhere in the system.

This probably likely exists in other places as well, but it becomes a
lot more apparent when it comes to creating invoices as the generation
of the PDFs take some time.
postgresqleu/confreg/views.py