Fix counters when discarding or deleting draft review requests.
Review Request #2504 — Created July 31, 2011 and submitted — Latest diff uploaded
Fix counters when discarding or deleting draft review requests. The counters in the sidebar would get messed up when discarding or deleting a draft review request. The code assumed that if we were saving or deleting a non-pending review request, we should decrement counts. However, this needed to take into account the old public state to determine if it had already incremented these counts. New unit tests were added to check for these conditions and to check for incrementing/decrementing on fields not yet initialized (such as after an upgrade).
Unit tests pass.