mirror of
https://github.com/haiwen/seahub.git
synced 2025-09-07 18:03:48 +00:00
Update captcha
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
import random
|
||||
from captcha.conf import settings
|
||||
from django.core.urlresolvers import reverse
|
||||
from six import u
|
||||
|
||||
|
||||
def math_challenge():
|
||||
@@ -15,14 +16,14 @@ def math_challenge():
|
||||
|
||||
|
||||
def random_char_challenge():
|
||||
chars, ret = u'abcdefghijklmnopqrstuvwxyz', u''
|
||||
chars, ret = u('abcdefghijklmnopqrstuvwxyz'), u('')
|
||||
for i in range(settings.CAPTCHA_LENGTH):
|
||||
ret += random.choice(chars)
|
||||
return ret.upper(), ret
|
||||
|
||||
|
||||
def unicode_challenge():
|
||||
chars, ret = u'äàáëéèïíîöóòüúù', u''
|
||||
chars, ret = u('äàáëéèïíîöóòüúù'), u('')
|
||||
for i in range(settings.CAPTCHA_LENGTH):
|
||||
ret += random.choice(chars)
|
||||
return ret.upper(), ret
|
||||
@@ -70,6 +71,10 @@ def noise_dots(draw, image):
|
||||
return draw
|
||||
|
||||
|
||||
def noise_null(draw, image):
|
||||
return draw
|
||||
|
||||
|
||||
def post_smooth(image):
|
||||
try:
|
||||
import ImageFilter
|
||||
|
Reference in New Issue
Block a user