[1.6.x] Corrected scoping of savepoint example
Backport of 27f68f8659
from master
This commit is contained in:
parent
0e3626260d
commit
d237aaa929
|
@ -522,8 +522,8 @@ you can roll back the single offending operation, rather than the entire
|
|||
transaction. For example::
|
||||
|
||||
a.save() # Succeeds, and never undone by savepoint rollback
|
||||
try:
|
||||
sid = transaction.savepoint()
|
||||
try:
|
||||
b.save() # Could throw exception
|
||||
transaction.savepoint_commit(sid)
|
||||
except IntegrityError:
|
||||
|
|
Loading…
Reference in New Issue