From 209ddd4952812b08d8428fe491372402abb290b4 Mon Sep 17 00:00:00 2001 From: Evgeny Fadeev Date: Sun, 20 May 2012 14:32:48 -0400 Subject: fixed a bug where reputation loss for dowvoting and receiving the downvote were swapped, spotted by zaf --- askbot/auth.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/askbot/auth.py b/askbot/auth.py index eba24c80..c80f5db1 100644 --- a/askbot/auth.py +++ b/askbot/auth.py @@ -338,13 +338,15 @@ def onDownVoted(vote, post, user, timestamp=None): if not (post.wiki or post.is_anonymous): author = post.author - author.receive_reputation(askbot_settings.REP_LOSS_FOR_DOWNVOTING) + author.receive_reputation( + askbot_settings.REP_LOSS_FOR_RECEIVING_DOWNVOTE + ) author.save() question = post.thread._question_post() # TODO: this is suboptimal if post is already a question reputation = Repute(user=author, - negative=askbot_settings.REP_LOSS_FOR_DOWNVOTING, + negative=askbot_settings.REP_LOSS_FOR_RECEIVING_DOWNVOTE, question=question, reputed_at=timestamp, reputation_type=-3, @@ -352,12 +354,12 @@ def onDownVoted(vote, post, user, timestamp=None): reputation.save() user.receive_reputation( - askbot_settings.REP_LOSS_FOR_RECEIVING_DOWNVOTE + askbot_settings.REP_LOSS_FOR_DOWNVOTING, ) user.save() reputation = Repute(user=user, - negative=askbot_settings.REP_LOSS_FOR_RECEIVING_DOWNVOTE, + negative=askbot_settings.REP_LOSS_FOR_DOWNVOTING, question=question, reputed_at=timestamp, reputation_type=-5, -- cgit v1.2.3-1-g7c22