Last change
on this file since 3128 was
3128,
checked in by vmaksymiv, 13 years ago
|
pep8 fixes
|
File size:
490 bytes
|
Line | |
---|
1 | ## Script (Python) "getCaptcha" |
---|
2 | ##bind container=container |
---|
3 | ##bind context=context |
---|
4 | ##bind namespace= |
---|
5 | ##bind script=script |
---|
6 | ##bind subpath=traverse_subpath |
---|
7 | ##parameters= |
---|
8 | ##title= |
---|
9 | from quintagroup.captcha.core.utils import getCaptchasCount, formKey, encrypt |
---|
10 | |
---|
11 | from random import randint |
---|
12 | # *randint* return random integer in range [a, b], |
---|
13 | # including *both* end points. |
---|
14 | key = formKey(randint(0, getCaptchasCount(True) - 1)) |
---|
15 | encrypted_key = encrypt(context.captcha_key, key) |
---|
16 | |
---|
17 | return encrypted_key |
---|
Note: See
TracBrowser
for help on using the repository browser.