mirror of
https://github.com/reddit-archive/reddit.git
synced 2026-01-28 00:07:57 -05:00
wiki: Handle wiki_edit_age or wiki_edit_karma being None.
This commit is contained in:
@@ -117,12 +117,12 @@ def may_revise(sr, user, page=None):
|
||||
return True
|
||||
|
||||
karma = max(user.karma('link', sr), user.karma('comment', sr))
|
||||
if karma < sr.wiki_edit_karma:
|
||||
if karma < (sr.wiki_edit_karma or 0):
|
||||
# If the user has too few karma, they should not contribute
|
||||
return False
|
||||
|
||||
age = (datetime.datetime.now(g.tz) - user._date).days
|
||||
if age < sr.wiki_edit_age:
|
||||
if age < (sr.wiki_edit_age or 0):
|
||||
# If they user's account is too young
|
||||
# They should not contribute
|
||||
return False
|
||||
|
||||
@@ -102,7 +102,8 @@ class Subreddit(Thing, Printable):
|
||||
allow_comment_gilding=True,
|
||||
)
|
||||
_essentials = ('type', 'name', 'lang')
|
||||
_data_int_props = Thing._data_int_props + ('mod_actions', 'reported')
|
||||
_data_int_props = Thing._data_int_props + ('mod_actions', 'reported',
|
||||
'wiki_edit_karma', 'wiki_edit_age')
|
||||
|
||||
sr_limit = 50
|
||||
gold_limit = 100
|
||||
|
||||
Reference in New Issue
Block a user