Only update Review.timestamp when saving that field

Review Request #795 - Created July 28, 2017 and updated

guest5739
Review Board
Master
1a515f2...
demo
guest5739
A previous patch (/r/9068/) updated `Review.save` to pass along all
keyword arguments, such as `update_fields`. However, we were still
always updating the timestamp field on the model, even if it wasn't
being saved to the database. This lead to inconsistencies between fields
on objects and fields in the database, causing a test failure. We now
only update the timestamp field specifically when we are updating all
fields or include `timestamp` in `update_fields` so that this does not
happen.

Testing Done:
With this patch applied, all unit tests pass.

Reviewed at https://reviews.reviewboard.org/r/9070/

Testing Done:
With this patch applied, all unit tests pass.

Reviewed at https://reviews.reviewboard.org/r/9070/

  • 8
  • 3
  • 4
  • 2
  • 17
Description From Last Updated
here guest3824 guest3824
definitly needs rewrite guest3824 guest3824
looks ok to me guest7649 guest7649
asdfasdf guest3412 guest3412
rewrite guest3824 guest3824
This is code guest6207 guest6207
kl;kl guest3412 guest3412
This is another test guest6207 guest6207
guest5739
guest5739
guest5739
Review request changed

People:

-John
guest5739
  1. Ship It!
  2. 
      
guest1710
  1. Ship It!
  2. 
      
guest6441
guest4232
  1. Ship It!
  2. 
      
guest8095
  1. Ship It!
  2. 
      
guest3748
  1. Ship It!
  2. 
      
guest6596
  1. Ship It!

  2. 
      
guest733
  1. 
      
  2. reviewboard/reviews/models/review.py (Diff revision 1)
     
     
     

    Test comment.

  3. 
      
guest733
  1. Ship It!
  2. 
      
guest3128
  1. Ship It!
  2. 
      
guest3128
  1. 
      
  2. 
      
guest3412
  1. Ship It!
  2. 
      
guest733
  1. 
      
  2. reviewboard/reviews/models/review.py (Diff revision 1)
     
     
     

    This is not good.

  3. 
      
guest733
  1. Ship It!
  2. 
      
guest5447
  1. Ship It!
  2. 
      
guest3824
  1. ok first comment

  2. 
      
guest3824
  1. 
      
  2. reviewboard/reviews/models/review.py (Diff revision 1)
     
     
     
     
     
     

    rewrite

  3. 
      
guest3824
guest3824
  1. 
      
  2. reviewboard/reviews/models/review.py (Diff revision 1)
     
     
     
     
     
     
     

    regarde ici

  3. 
      
guest1629
  1. tttest

  2. 
      
guest1629
  1. 
      
  2. rewrite rewrite

  3. 
      
guest1629
  1. 
      
  2. issure to be verified

  3. 
      
guest4122
  1. 
      
  2. reviewboard/reviews/models/review.py (Diff revision 1)
     
     
     
  3. 
      
guest6207
  1. 
      
  2. reviewboard/reviews/models/review.py (Diff revision 1)
     
     
     
     
     
     

    This is code

  3. reviewboard/reviews/models/review.py (Diff revision 1)
     
     

    This is another test

  4. 
      
guest6613
  1. Ship It!

  2. 
      
guest6613
guest9
  1. asd

  2. 
      
guest9
  1. 
      
  2. 
      
guest7649
  1. 
      
  2. reviewboard/reviews/models/review.py (Diff revision 1)
     
     
     

    looks ok to me

  3. 
      
guest7649
  1. 
      
  2. 
      
guest3412
  1. 
      
  2. reviewboard/reviews/models/review.py (Diff revision 1)
     
     
     

    asdfasdf

  3. 
      
Loading...