Skip to content

Commit

Permalink
Fixed 2.6 DeprecationWarning with sha module.
Browse files Browse the repository at this point in the history
  • Loading branch information
brosner committed Apr 4, 2009
1 parent 5a7dc04 commit 443d03d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions friends/models.py
@@ -1,13 +1,13 @@
import datetime
from random import random
import sha

from django.db import models

from django.template.loader import render_to_string
from django.core.urlresolvers import reverse
from django.contrib.auth.models import User
from django.contrib.sites.models import Site
from django.utils.hashcompat import sha_constructor

from django.db.models import signals

Expand Down Expand Up @@ -101,8 +101,8 @@ class JoinInvitationManager(models.Manager):

def send_invitation(self, from_user, to_email, message):
contact, created = Contact.objects.get_or_create(email=to_email, user=from_user)
salt = sha.new(str(random())).hexdigest()[:5]
confirmation_key = sha.new(salt + to_email).hexdigest()
salt = sha_constructor.new(str(random())).hexdigest()[:5]
confirmation_key = sha_constructor.new(salt + to_email).hexdigest()
accept_url = u"http://%s%s" % (
unicode(Site.objects.get_current()),
reverse("friends_accept_join", args=(confirmation_key,)),
Expand Down

0 comments on commit 443d03d

Please sign in to comment.