Permalink
Browse files

Replace deprecated Django sha_constructor with hashlib

  • Loading branch information...
1 parent 4857e40 commit 384177fc282ecad38fce477a7cc8540af3531827 @bruth bruth committed May 7, 2013
Showing with 2 additions and 2 deletions.
  1. +2 −2 serrano/tokens.py
View
@@ -1,6 +1,6 @@
+import hashlib
from datetime import datetime
from django.conf import settings
-from django.utils.hashcompat import sha_constructor
from django.utils.http import int_to_base36, base36_to_int
@@ -10,7 +10,7 @@ def _total_seconds(self, dt):
def _make(self, user, timestamp):
ts_b36 = int_to_base36(timestamp)
- digest = sha_constructor(settings.SECRET_KEY + unicode(user.pk) + \
+ digest = hashlib.sha1(settings.SECRET_KEY + unicode(user.pk) + \
user.password + unicode(timestamp)).hexdigest()[::2]
return '{0}-{1}-{2}'.format(user.pk, ts_b36, digest)

0 comments on commit 384177f

Please sign in to comment.