Skip to content

Commit

Permalink
Remove django.utils.hashcompat import. Make it compatible with Django…
Browse files Browse the repository at this point in the history
… 1.6
  • Loading branch information
joashxu committed Feb 24, 2014
1 parent 2d8f4bf commit 8af7513
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions emailconfirmation/models.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import datetime
from random import random
from hashlib import sha1

from django.conf import settings
from django.db import models, IntegrityError
from django.core.mail import send_mail
from django.core.urlresolvers import reverse, NoReverseMatch
from django.template.loader import render_to_string
from django.utils.hashcompat import sha_constructor
from django.utils.translation import gettext_lazy as _

from django.contrib.sites.models import Site
Expand Down Expand Up @@ -91,8 +91,8 @@ def confirm_email(self, confirmation_key):
return email_address

def send_confirmation(self, email_address):
salt = sha_constructor(str(random())).hexdigest()[:5]
confirmation_key = sha_constructor(salt + email_address.email).hexdigest()
salt = sha1(str(random())).hexdigest()[:5]
confirmation_key = sha1(salt + email_address.email).hexdigest()
current_site = Site.objects.get_current()
# check for the url with the dotted view path
try:
Expand Down

0 comments on commit 8af7513

Please sign in to comment.