Change ReviewRequestVisit.objects.update_visibility to use upsert.

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

david
Review Board
release-6.x
reviewboard

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.

Summary
Change ReviewRequestVisit.objects.update_visibility to use upsert.
Description From Last Updated

This can be one statement now, just tacking on a [0].

chipx86chipx86
david
chipx86
  1. 
      
  2. reviewboard/accounts/managers.py (Diff revision 2)
     
     
     
     
     
     
     
     
     
     
     
     
     

    This can be one statement now, just tacking on a [0].

  3. 
      
david
Review request changed

Status: Closed (submitted)

Change Summary:

Pushed to release-6.x (2e49a4a)
Loading...