Change ReviewRequestVisit.objects.update_visibility to use upsert.

Review Request #12697 — Created Oct. 25, 2022 and submitted — Latest diff uploaded

Information

Review Board
release-6.x

Reviewers

Django has a new(ish) method for handling upserts itself,
update_or_create. Switching to this actually fixes a bug in the
existing code where update_visibility wasn't updating the timestamp if
the visibility wasn't changing.

While updating this, I noticed that the unit tests for these weren't in
the accounts/tests/ directory so I've moved that too.

Ran unit tests.

Changes between revision 1 and 2

orig
1
2

Commits

Summary ID Author
Change ReviewRequestVisit.objects.update_visibility to use upsert.
Django has a new(ish) method for handling upserts itself, `update_or_create`. Switching to this actually fixes a bug in the existing code where `update_visibility` wasn't updating the timestamp if the visibility wasn't changing. While updating this, I noticed that the unit tests for these weren't in the `accounts/tests/` directory so I've moved that too. Testing Done: Ran unit tests.
3f262589fb256c6439ee395f70cf829ce09101d8 David Trowbridge
Change ReviewRequestVisit.objects.update_visibility to use upsert.
Django has a new(ish) method for handling upserts itself, `update_or_create`. Switching to this actually fixes a bug in the existing code where `update_visibility` wasn't updating the timestamp if the visibility wasn't changing. While updating this, I noticed that the unit tests for these weren't in the `accounts/tests/` directory so I've moved that too. Testing Done: Ran unit tests.
dcf05a61d1e1bf959f22759fc6f2af8de91949a0 David Trowbridge
reviewboard/accounts/tests/test_review_request_visit_manager.py
Loading...