X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=PLC%2FMethods%2FResetPassword.py;fp=PLC%2FMethods%2FResetPassword.py;h=6a35a4d444385943c4a647c98b3c2b6b4ae5ffe3;hb=aed64f31afdf04bdd6e22f3b1efdd61a2d63174a;hp=8036969f5e5198bb8c65706ca896a4d17c6f667f;hpb=b92fd6505ef9a6e2e3532add89f0eb368bd4e2e2;p=plcapi.git diff --git a/PLC/Methods/ResetPassword.py b/PLC/Methods/ResetPassword.py index 8036969..6a35a4d 100644 --- a/PLC/Methods/ResetPassword.py +++ b/PLC/Methods/ResetPassword.py @@ -63,9 +63,9 @@ class ResetPassword(Method): raise PLCInvalidArgument("Cannot reset admin passwords") # Generate 32 random bytes - bytes = random.sample(range(0, 256), 32) + int8s = random.sample(range(0, 256), 32) # Base64 encode their string representation - random_key = base64.b64encode("".join(map(chr, bytes))) + random_key = base64.b64encode(bytes(int8s)) if verification_key is not None: if person['verification_key'] is None or \