Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ProposalResult.update_vote doesn't work on delete #137

Open
chrisjrn opened this issue Jun 19, 2016 · 1 comment
Open

ProposalResult.update_vote doesn't work on delete #137

chrisjrn opened this issue Jun 19, 2016 · 1 comment

Comments

@chrisjrn
Copy link

Steps to reproduce:

  • Add review with +1 score
  • Overwrite review with +0 score
  • Delete review with +1 score
  • Delete review with +0 score

Expected:

  • 0 x +1 votes
  • 0 x +0 votes

Actual:

  • 1 x +0 vote
  • -1 x +1 vote
@chrisjrn
Copy link
Author

Fundamentally the update_vote method is a bit of a shambles, and appears to be fundamentally broken on the delete case. My guess is that making full_calculate a bit more database efficient would be a far far far far better solution here.

chrisjrn added a commit to chrisjrn/symposion that referenced this issue Jun 19, 2016
Fixes pinax#137. The previous `update_vote` broke severely on deletion. This optimises the queries done in `full_calculate` (to use a single `annotate`) and makes `update_vote` use the inner query of `full_calculate`. Far less weird, far more working.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants