Make disable_captcha work properly with unlogged users.

This commit is contained in:
Bryce Boe
2011-12-06 20:49:38 -08:00
committed by Neil Williams
parent d0a338cb72
commit 7e0140972f
2 changed files with 2 additions and 2 deletions

View File

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

View File

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