mirror of
https://github.com/reddit-archive/reddit.git
synced 2026-01-28 16:28:01 -05:00
Don't count karma for self-posts
This commit is contained in:
@@ -58,6 +58,10 @@ class Vote(MultiRelation('vote',
|
||||
sr = obj.subreddit_slow
|
||||
kind = obj.__class__.__name__.lower()
|
||||
karma = sub.karma(kind, sr)
|
||||
|
||||
is_self_link = (kind == 'link'
|
||||
and hasattr(obj,'is_self')
|
||||
and obj.is_self)
|
||||
|
||||
#check for old vote
|
||||
rel = cls.rel(sub, obj)
|
||||
@@ -91,7 +95,8 @@ class Vote(MultiRelation('vote',
|
||||
v.ip = ip
|
||||
old_valid_thing = v.valid_thing = ((not spam)
|
||||
and valid_thing(v, karma))
|
||||
v.valid_user = v.valid_thing and valid_user(v, sr, karma)
|
||||
v.valid_user = (v.valid_thing and valid_user(v, sr, karma)
|
||||
and not is_self_link)
|
||||
if organic:
|
||||
v.organic = organic
|
||||
|
||||
|
||||
Reference in New Issue
Block a user