change noise default
This commit is contained in:
@@ -3,9 +3,10 @@ import random
|
|||||||
|
|
||||||
from rest_captcha.settings import api_settings as settings
|
from rest_captcha.settings import api_settings as settings
|
||||||
from django.conf import settings as django_setting
|
from django.conf import settings as django_setting
|
||||||
|
from PIL import ImageFont, ImageDraw, Image
|
||||||
|
from .serializers import noise_default
|
||||||
from django.core.cache import caches
|
from django.core.cache import caches
|
||||||
from rest_captcha import captcha
|
from rest_captcha import captcha
|
||||||
from PIL import ImageFont, ImageDraw, Image
|
|
||||||
from io import BytesIO as StringIO
|
from io import BytesIO as StringIO
|
||||||
|
|
||||||
cache = caches[settings.CAPTCHA_CACHE]
|
cache = caches[settings.CAPTCHA_CACHE]
|
||||||
@@ -59,7 +60,7 @@ def generate_image(word):
|
|||||||
draw = ImageDraw.Draw(image)
|
draw = ImageDraw.Draw(image)
|
||||||
|
|
||||||
# settings.FILTER_FUNCTION(image)
|
# settings.FILTER_FUNCTION(image)
|
||||||
settings.NOISE_FUNCTION(image, draw)
|
noise_default(image, draw)
|
||||||
|
|
||||||
out = StringIO()
|
out = StringIO()
|
||||||
image.save(out, 'PNG')
|
image.save(out, 'PNG')
|
||||||
|
|||||||
Reference in New Issue
Block a user