Use hashlib rather than django.utils.hashcompat

This commit is contained in:
Rebecca Lovewell 2014-01-15 09:22:16 -05:00
parent e9c97a9586
commit dff5c4b1bb

View file

@ -1,3 +1,4 @@
import hashlib
import random
import sys
@ -6,7 +7,6 @@ from django.core.exceptions import ObjectDoesNotExist
from django.db.models import Q
from django.http import Http404, HttpResponse, HttpResponseForbidden
from django.shortcuts import render, redirect, get_object_or_404
from django.utils.hashcompat import sha_constructor
from django.views import static
from django.contrib import messages
@ -110,8 +110,8 @@ def proposal_speaker_manage(request, pk):
Q(user=None, invite_email=email_address)
)
except Speaker.DoesNotExist:
salt = sha_constructor(str(random.random())).hexdigest()[:5]
token = sha_constructor(salt + email_address).hexdigest()
salt = hashlib.sha1(str(random.random())).hexdigest()[:5]
token = hashlib.sha1(salt + email_address).hexdigest()
pending = Speaker.objects.create(
invite_email=email_address,
invite_token=token,