Change ReviewRequestVisit.objects.update_visibility to use upsert.
Review Request #12697 — Created Oct. 25, 2022 and submitted — Latest diff uploaded
Django has a new(ish) method for handling upserts itself,
update_or_create
. Switching to this actually fixes a bug in the
existing code whereupdate_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
theaccounts/tests/
directory so I've moved that too.
Ran unit tests.
Diff Revision 2 (Latest)
orig
1
2
Commits
Files
reviewboard/accounts/managers.py | ||
reviewboard/accounts/tests/test_review_request_visit_manager.py Was reviewboard/accounts/test_review_request_visit_manager.py |
reviewboard/accounts/managers.py |
---|
reviewboard/accounts/test_review_request_visit_manager.py |
---|