mirror of
https://github.com/dkmstr/openuds.git
synced 2024-12-22 13:34:04 +03:00
small fixex
This commit is contained in:
parent
83290f0a29
commit
47d234e1c5
@ -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)):
|
||||
|
@ -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))
|
||||
|
Loading…
Reference in New Issue
Block a user