#31423 closed Cleanup/optimization (fixed)
Clarify using nested database transactions in atomic() docs.
Reported by: | AxeOfMen | Owned by: | Simon Charette |
---|---|---|---|
Component: | Documentation | Version: | 3.0 |
Severity: | Normal | Keywords: | documentation transaction atomic |
Cc: | Triage Stage: | Accepted | |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | yes | UI/UX: | no |
Description
There is an example on the transactions documentation page of using the atomic context manager in a try/except block. The example uses both the atomic context manager and decorator. Is this intentional? If so, text describing the intent and purpose of using both would be appropriate. My guess is that it is unintentional and that the decorator should be removed.
https://github.com/django/django/blob/master/docs/topics/db/transactions.txt#L134
Change History (4)
comment:3 by , 5 years ago
Has patch: | set |
---|---|
Owner: | changed from | to
Status: | new → assigned |
Summary: | Transactions documentation error → Clarify using nested database transactions in atomic() docs. |
Triage Stage: | Unreviewed → Accepted |
Type: | Bug → Cleanup/optimization |
Yes this is intentional. Clarification proposed by Simon looks good to me.
Note:
See TracTickets
for help on using tickets.
I think usage of both is a view decorator and a context manager is intentional
Maybe the text could be augmented with ... are still there and are part of the same transaction. to denote that either both changes would be committed or rolled back.