mirror of
https://github.com/reddit-archive/reddit.git
synced 2026-01-25 06:48:01 -05:00
Make disable_captcha work properly with unlogged users.
This commit is contained in:
@@ -585,7 +585,7 @@ class VCaptcha(Validator):
|
||||
default_param = ('iden', 'captcha')
|
||||
|
||||
def run(self, iden, solution):
|
||||
if (not c.user_is_loggedin or c.user.needs_captcha()):
|
||||
if c.user.needs_captcha():
|
||||
valid_captcha = captcha.valid_solution(iden, solution)
|
||||
if not valid_captcha:
|
||||
self.set_error(errors.BAD_CAPTCHA)
|
||||
|
||||
@@ -213,7 +213,7 @@ class Account(Thing):
|
||||
return id_time + ',' + sha.new(to_hash).hexdigest()
|
||||
|
||||
def needs_captcha(self):
|
||||
return self.link_karma < 1 and not g.disable_captcha
|
||||
return not g.disable_captcha and self.link_karma < 1
|
||||
|
||||
def modhash(self, rand=None, test=False):
|
||||
return modhash(self, rand = rand, test = test)
|
||||
|
||||
Reference in New Issue
Block a user