Commits

Hynek Cernoch  committed 189a21d Draft

Fixed to sha hashlib

  • Participants
  • Parent commits 3270f69

Comments (0)

Files changed (2)

File registration/models.py

 from django.db import models
 from django.db import transaction
 from django.template.loader import render_to_string
-from django.utils.hashcompat import sha_constructor
+from hashlib import sha1
 from django.utils.translation import ugettext_lazy as _
 from django.contrib.auth.models import User
 from django.contrib.sites.models import Site
         username and a random salt.
         
         """
-        salt = sha_constructor(str(random.random())).hexdigest()[:5]
-        activation_key = sha_constructor(salt+user.username).hexdigest()
+        salt = sha1(str(random.random())).hexdigest()[:5]
+        activation_key = sha1(salt+user.username).hexdigest()
         return self.create(user=user,
                            activation_key=activation_key)
         

File registration/tests.py

 """
 
 import datetime
-import sha
+from hashlib import sha1 as sha
 
 from django.conf import settings
 from django.contrib.auth.models import User