fixing generate_hash method.
1 files changed, 3 insertions(+), 2 deletions(-) M webutils/baseacct/models.py
M webutils/baseacct/models.py +3 -2
@@ 10,9 10,10 @@ class BaseUserProfileManager(UserManager import hashlib import random - salt = hashlib.sha1(str(random.random())).hexdigest()[:5] + salt = hashlib.sha1( + str(random.random()).encode('utf-8')).hexdigest()[:5] random_string = User.objects.make_random_password() - return hashlib.sha1(salt + random_string).hexdigest() + return hashlib.sha1((salt + random_string).encode('utf-8')).hexdigest() def send_user_email(self, user, subject, context, template): send_simple_email(