Permalink
Browse files

Don't exclude old items with recent votes from 30-day karma calculations

In other words, if an item is five years old, but was voted on yesterday, the karma change still occurred recently, so it should still be treated as a recent change, regardless of the age of the underlying item.
  • Loading branch information...
1 parent 778adfa commit c2d55e5c2b330fe9ae8b4472a7655b333e31cdc4 @johnsoft johnsoft committed Oct 27, 2012
Showing with 2 additions and 2 deletions.
  1. +2 −2 r2/r2/lib/user_stats.py
View
@@ -139,7 +139,7 @@ def user_vote_change_links(period=None, user=None):
link_dt.c.thing_id == rt.c.thing2_id)
if period is not None:
earliest = datetime.now(g.tz) - timedelta(0, period)
- query.clauses.extend((rt.c.date >= earliest, link_tt.c.date >= earliest))
+ query.clauses.append(rt.c.date >= earliest)
if user is not None:
query.clauses.append(author_dt.c.value == str(user._id))
@@ -171,7 +171,7 @@ def user_vote_change_comments(period=None, user=None):
comment_tt.c.thing_id == rt.c.thing2_id)
if period is not None:
earliest = datetime.now(g.tz) - timedelta(0, period)
- query.clauses.extend((rt.c.date >= earliest, comment_tt.c.date >= earliest))
+ query.clauses.append(rt.c.date >= earliest)
if user is not None:
query.clauses.append(author_dt.c.value == str(user._id))

0 comments on commit c2d55e5

Please sign in to comment.