mirror of
https://github.com/reddit-archive/reddit.git
synced 2026-01-29 00:38:11 -05:00
wiki: Use global karma for frontpage wiki.
This commit is contained in:
@@ -112,8 +112,13 @@ def may_revise(sr, user, page=None):
|
||||
# If the user can not submit to the subreddit
|
||||
# They should not be able to contribute
|
||||
return False
|
||||
|
||||
karma = max(user.karma('link', sr), user.karma('comment', sr))
|
||||
|
||||
# Use global karma for the frontpage wiki
|
||||
karma_sr = sr if sr.wiki_use_subreddit_karma else None
|
||||
|
||||
# Use link or comment karma, whichever is greater
|
||||
karma = max(user.karma('link', karma_sr), user.karma('comment', karma_sr))
|
||||
|
||||
if karma < (sr.wiki_edit_karma or 0):
|
||||
# If the user has too few karma, they should not contribute
|
||||
return False
|
||||
|
||||
@@ -303,6 +303,10 @@ class Subreddit(Thing, Printable):
|
||||
def accounts_active(self):
|
||||
return self.get_accounts_active()[0]
|
||||
|
||||
@property
|
||||
def wiki_use_subreddit_karma(self):
|
||||
return True
|
||||
|
||||
def get_accounts_active(self):
|
||||
fuzzed = False
|
||||
count = AccountsActiveBySR.get_count(self)
|
||||
@@ -1117,6 +1121,10 @@ class DefaultSR(_DefaultSR):
|
||||
except NotFound:
|
||||
self._base = None
|
||||
|
||||
@property
|
||||
def wiki_use_subreddit_karma(self):
|
||||
return False
|
||||
|
||||
@property
|
||||
def _should_wiki(self):
|
||||
return True
|
||||
|
||||
Reference in New Issue
Block a user