mirror of
https://github.com/reddit-archive/reddit.git
synced 2026-04-05 03:00:15 -04:00
Allow private code to have a say in ratelimiting.
This commit is contained in:
@@ -1191,8 +1191,14 @@ class VRatelimit(Validator):
|
||||
Validator.__init__(self, *a, **kw)
|
||||
|
||||
def run (self):
|
||||
from r2.models.admintools import admin_ratelimit
|
||||
|
||||
if g.disable_ratelimit:
|
||||
return
|
||||
|
||||
if c.user_is_loggedin and not admin_ratelimit(c.user):
|
||||
return
|
||||
|
||||
to_check = []
|
||||
if self.rate_user and c.user_is_loggedin:
|
||||
to_check.append('user' + str(c.user._id36))
|
||||
|
||||
@@ -317,6 +317,9 @@ def update_gold_users(verbose=False):
|
||||
delta, account = minimum
|
||||
print "Next expiration is %s, in %d days" % (account.name, delta.days)
|
||||
|
||||
def admin_ratelimit(user):
|
||||
return True
|
||||
|
||||
def is_banned_IP(ip):
|
||||
return False
|
||||
|
||||
|
||||
Reference in New Issue
Block a user