Skip to content

Commit

Permalink
[bug 834713] Fix parameters to KarmaManager.count() call.
Browse files Browse the repository at this point in the history
  • Loading branch information
rlr committed Jan 25, 2013
1 parent e7b0d34 commit a12c0fd
Showing 1 changed file with 13 additions and 12 deletions.
25 changes: 13 additions & 12 deletions apps/karma/admin.py
Expand Up @@ -88,30 +88,31 @@ def karma(request):
def _user_karma_alltime(user, kmgr):
return {
'user': user,
'points': kmgr.count(user, type='points'),
'answers': kmgr.count(user, type=AnswerAction.action_type),
'first_answers': kmgr.count(user, type=FirstAnswerAction.action_type),
'points': kmgr.count(user=user, type='points'),
'answers': kmgr.count(user=user, type=AnswerAction.action_type),
'first_answers': kmgr.count(
user=user, type=FirstAnswerAction.action_type),
'helpful_votes': kmgr.count(
user, type=AnswerMarkedHelpfulAction.action_type),
user=user, type=AnswerMarkedHelpfulAction.action_type),
'nothelpful_votes': kmgr.count(
user, type=AnswerMarkedNotHelpfulAction.action_type),
'solutions': kmgr.count(user, type=SolutionAction.action_type),
user=user, type=AnswerMarkedNotHelpfulAction.action_type),
'solutions': kmgr.count(user=user, type=SolutionAction.action_type),
}


def _user_karma_week(user, kmgr):
return {
'user': user,
'points': kmgr.count(user, daterange='1w', type='points'),
'points': kmgr.count(daterange='1w', user=user, type='points'),
'answers': kmgr.count(
user, daterange='1w', type=AnswerAction.action_type),
daterange='1w', user=user, type=AnswerAction.action_type),
'first_answers': kmgr.count(
user, daterange='1w', type=FirstAnswerAction.action_type),
daterange='1w', user=user, type=FirstAnswerAction.action_type),
'helpful_votes': kmgr.count(
user, daterange='1w', type=AnswerMarkedHelpfulAction.action_type),
daterange='1w', user=user, type=AnswerMarkedHelpfulAction.action_type),
'nothelpful_votes': kmgr.count(
user, daterange='1w',
daterange='1w', user=user,
type=AnswerMarkedNotHelpfulAction.action_type),
'solutions': kmgr.count(
user, daterange='1w', type=SolutionAction.action_type),
daterange='1w', user=user, type=SolutionAction.action_type),
}

0 comments on commit a12c0fd

Please sign in to comment.