-
-
Save ronbeltran/67060861b477d4aece43 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
The activation key for the ``UserProfile`` will be a | |
SHA1 hash, generated from a combination of the ``User``'s | |
email and a random salt. | |
""" | |
salt = hashlib.sha1(str(random.random())).hexdigest()[:5] | |
email = user.email | |
if isinstance(email, unicode): | |
email = email.encode('utf-8') | |
activation_key = hashlib.sha1(salt+email).hexdigest() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment