1
0
mirror of https://github.com/dkmstr/openuds.git synced 2024-12-22 13:34:04 +03:00

small fixex

This commit is contained in:
Adolfo Gómez García 2019-03-15 13:20:48 +01:00
parent 83290f0a29
commit 47d234e1c5
2 changed files with 3 additions and 3 deletions

View File

@ -100,7 +100,7 @@ class ContentProcessor(object):
return obj
elif isinstance(obj, dict):
res = {}
for k, v in obj.item():
for k, v in obj.items():
res[k] = ContentProcessor.procesForRender(v)
return res
elif isinstance(obj, (list, tuple, types.GeneratorType)):

View File

@ -182,12 +182,12 @@ class CryptoManager(object):
if obj is None:
obj = self.randomString()
self._counter += 1
elif isinstance(obj, six.binary_type):
elif isinstance(obj, bytes):
obj = obj.decode('utf8') # To binary
else:
obj = '{}'.format(obj)
return six.text_type(uuid.uuid5(self._namespace, obj)).lower() # I believe uuid returns a lowercase uuid always, but in case... :)
return str(uuid.uuid5(self._namespace, obj)).lower() # I believe uuid returns a lowercase uuid always, but in case... :)
def randomString(self, length=40):
return ''.join(random.choice(string.ascii_lowercase + string.digits) for _ in range(length))