summaryrefslogtreecommitdiffstats
path: root/module
diff options
context:
space:
mode:
Diffstat (limited to 'module')
-rw-r--r--module/CaptchaManager.py4
-rw-r--r--module/remote/thriftbackend/Handler.py8
2 files changed, 5 insertions, 7 deletions
diff --git a/module/CaptchaManager.py b/module/CaptchaManager.py
index 7bb98dde9..7672aa645 100644
--- a/module/CaptchaManager.py
+++ b/module/CaptchaManager.py
@@ -52,7 +52,7 @@ class CaptchaManager():
def getTaskByID(self, tid):
self.lock.acquire()
for task in self.tasks:
- if task.id == tid:
+ if task.id == str(tid): #task ids are strings
self.lock.release()
return task
self.lock.release()
@@ -82,7 +82,7 @@ class CaptchaManager():
class CaptchaTask():
def __init__(self, id, img, type, temp):
- self.id = id
+ self.id = str(id)
self.captchaImg = img
self.captchaType = type
self.captchaFile = temp
diff --git a/module/remote/thriftbackend/Handler.py b/module/remote/thriftbackend/Handler.py
index 7209c6bd5..62896af9f 100644
--- a/module/remote/thriftbackend/Handler.py
+++ b/module/remote/thriftbackend/Handler.py
@@ -6,7 +6,7 @@ from thriftgen.pyload.Pyload import Iface
from module.PyFile import PyFile
from module.utils import freeSpace
-from base64 import b64encode
+from base64 import standard_b64encode
class Handler(Iface):
def __init__(self, backend):
@@ -444,10 +444,8 @@ class Handler(Iface):
Parameters:
- exclusive
"""
- t = CaptchaTask()
- t.tid, t.data, t.type = self.serverMethods.get_captcha_task(exclusive)
- t.tid = int(t.tid)
- t.data = b64encode(t.data)
+ tid, data, type = self.serverMethods.get_captcha_task(exclusive)
+ t = CaptchaTask(int(tid), standard_b64encode(data), type)
return t
def getCaptchaTaskStatus(self, tid):