wiki: Use global karma for frontpage wiki.

This commit is contained in:
Andre D
2013-02-22 13:23:15 -05:00
committed by Neil Williams
parent 6da0017152
commit 0bb4605a53
2 changed files with 15 additions and 2 deletions

View File

@@ -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

View File

@@ -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