File tree Expand file tree Collapse file tree 1 file changed +2
-2
lines changed
Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -44,7 +44,7 @@ def login(instance):
4444 username = instance .get ('username' )
4545 password = instance .get ('password' )
4646 captcha = instance .get ('captcha' )
47- captcha_cache = cache .get (Cache_Version .CAPTCHA .get_key (captcha = captcha ),
47+ captcha_cache = cache .get (Cache_Version .CAPTCHA .get_key (captcha = captcha . lower () ),
4848 version = Cache_Version .CAPTCHA .get_version ())
4949 if captcha_cache is None :
5050 raise AppApiException (1005 , _ ("Captcha code error or expiration" ))
@@ -76,6 +76,6 @@ def generate():
7676 image = ImageCaptcha ()
7777 data = image .generate (chars )
7878 captcha = base64 .b64encode (data .getbuffer ())
79- cache .set (Cache_Version .CAPTCHA .get_key (captcha = chars ), chars ,
79+ cache .set (Cache_Version .CAPTCHA .get_key (captcha = chars . lower () ), chars ,
8080 timeout = 60 , version = Cache_Version .CAPTCHA .get_version ())
8181 return {'captcha' : 'data:image/png;base64,' + captcha .decode ()}
You can’t perform that action at this time.
0 commit comments