#14550 closed (fixed)
commit_on_success no longer sets back to autocommit mode
Reported by: | Florian Apolloner | Owned by: | nobody |
---|---|---|---|
Component: | Database layer (models, ORM) | Version: | dev |
Severity: | Keywords: | ||
Cc: | Triage Stage: | Unreviewed | |
Has patch: | no | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
commit_on_success doesn't reset to the autocommit transaction state since r14288. If I understand the new decorator/context_manager code correctly we will need a leave_transaction_management in commit_on_success.exiting.
Note:
See TracTickets
for help on using tickets.
Here's how to reproduce. Create an application, and place the following in
models.py
:Then, create a module in the application called
load.py
, and insert the following:Assuming the code is inside an application entitled
ukraine
, and the database synced, then follow the below instructions:./manage.py shell
from ukraine import load; load.run()
./manage.py shell
and query the database. Theua_name
field is not set because the transaction was not committed. This does not happen in 1.2.X.