# HG changeset patch # User Gustavo Andres Morero # Date 1530562833 10800 # Mon Jul 02 17:20:33 2018 -0300 # Node ID 50e1b2bf7b42750d875be2ec49c9ab9a414b7e24 # Parent 10c3cad0bab237529ac98ee0ce3f5139ad6c2e87 fixing generate_hash method. diff --git a/webutils/baseacct/models.py b/webutils/baseacct/models.py --- a/webutils/baseacct/models.py +++ b/webutils/baseacct/models.py @@ -10,9 +10,10 @@ 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(