Commit cf511b48 authored by Jérome Perrin's avatar Jérome Perrin

CaptchaField: py3

parent 46d060aa
...@@ -115,7 +115,7 @@ class NumericCaptchaProvider(object): ...@@ -115,7 +115,7 @@ class NumericCaptchaProvider(object):
def generate(self, field): def generate(self, field):
# First step : generate the calculus. It is really simple. # First step : generate the calculus. It is really simple.
terms = [str(random.randint(1, 20)), random.choice(self.operator_set.keys())] terms = [str(random.randint(1, 20)), random.choice(list(self.operator_set.keys()))]
#XXX: Find a way to prevent too complex captchas (for instance 11*7*19...) #XXX: Find a way to prevent too complex captchas (for instance 11*7*19...)
#terms += [str(random.randint(1, 20)), random.choice(operator_set.keys())] #terms += [str(random.randint(1, 20)), random.choice(operator_set.keys())]
terms.append(str(random.randint(1, 20))) terms.append(str(random.randint(1, 20)))
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment