Hynek Cernoch committed 0d9e2ea

Use django.util.hashcompat to avoid deprecation warnings for SHA on Python 2.6+

Combined original changesets 218:97c29a915c25 and 219:0cd1690c11db.

  • Participants
  • Parent commits 00a5396

Comments (0)

Files changed (1)


 import datetime
 import random
 import re
-import sha
 from django.conf import settings
 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 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 =[:5]
+        salt = sha_constructor(str(random.random())).hexdigest()[:5]
         activation_key =
         return self.create(user=user,