Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Replace smart_str by smart_bytes in order to be compatible with python 3 #2

Merged
merged 1 commit into from
Dec 9, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions auth_remember/auth_utils.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"""Taken from django-dev (should be standard in django 1.4)"""
import hashlib
from django.utils.encoding import smart_str
from django.utils.encoding import smart_bytes
from django.utils.crypto import constant_time_compare

UNUSABLE_PASSWORD = '!' # This will never be a valid hash
Expand All @@ -10,7 +10,7 @@ def get_hexdigest(algorithm, salt, raw_password):
Returns a string of the hexdigest of the given plaintext password and salt
using the given algorithm ('md5', 'sha1' or 'crypt').
"""
raw_password, salt = smart_str(raw_password), smart_str(salt)
raw_password, salt = smart_bytes(raw_password), smart_bytes(salt)
if algorithm == 'crypt':
try:
import crypt
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ def finalize_options(self):

setup(
name='django-auth-remember',
version='0.5',
version='0.6',
url='https://github.com/ailabs/django-auth-remember/',
license='MIT',
author='Michael van Tellingen',
Expand Down