Switch out ConcurrencyManager for Manager.

Review Request #14073 — Created Aug. 4, 2024 and submitted — Latest diff uploaded

Information

Review Board
master

Reviewers

Early on in Django history, the built-in Manager.get_or_create method
was racy, potentially raising IntegrityError. We had built a
ConcurrencyManager to handle this case, and used it for many of our
models where we encountered issues.

As of quite some time ago, Django's built-in Manager does exactly the
same thing as our ConcurrencyManager did, and we just didn't discover
that because everything was working as expected. We've deprecated the
ConcurrencyManager as a result. This change swaps out all our usage to
just use the built-in Manager class.

Ran unit tests.

Diff Revision 2 (Latest)

orig
1
2

Commits

First Last Summary ID Author
Switch out ConcurrencyManager for Manager.
Early on in Django history, the built-in `Manager.get_or_create` method was racy, potentially raising `IntegrityError`. We had built a `ConcurrencyManager` to handle this case, and used it for many of our models where we encountered issues. As of quite some time ago, Django's built-in `Manager` does exactly the same thing as our `ConcurrencyManager` did, and we just didn't discover that because everything was working as expected. We've deprecated the ConcurrencyManager as a result. This change swaps out all our usage to just use the built-in `Manager` class. Testing Done: Ran unit tests.
e13897bb1c52d4a9ed5fc38727ad38ea4f6cbb4c David Trowbridge
reviewboard/accounts/managers.py
reviewboard/accounts/models.py
reviewboard/reviews/managers.py
reviewboard/reviews/models/review_request_draft.py
Loading...