mirror of
https://github.com/retspen/webvirtcloud
synced 2026-11-08 19:26:48 +00:00
With one owner per VM, the VM page and a user's page counted the VM's owners and then added one in separate steps, so two owners added at the same moment both found the VM without one, and it got two. The check and the insert now run in one transaction that holds the ownership lock (PostgreSQL's advisory lock; SQLite's IMMEDIATE transactions already serialize them): the second waits for the first and is refused. The audit row is written after the transaction, so a failure keeps its row. |
||
|---|---|---|
| .. | ||
| migrations | ||
| templates | ||
| templatetags | ||
| tests | ||
| __init__.py | ||
| apps.py | ||
| auth.py | ||
| checks.py | ||
| forms.py | ||
| lockout.py | ||
| middleware.py | ||
| models.py | ||
| otp.py | ||
| urls.py | ||
| utils.py | ||
| views.py | ||