Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- user = User.objects.get(username=username)
- passed_hash = hashlib.md5()
- passed_hash.update(password)
- saved_hash = hashlib.md5()
- saved_hash.update(user.get_profile().password)
- if user.get_profile().password == password or saved_hash.hexdigest() == password or passed_hash.hexdigest() == user.get_profile().password:
- return user
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement