Use hashlib rather than django.utils.hashcompat
This commit is contained in:
parent
e9c97a9586
commit
dff5c4b1bb
1 changed files with 31 additions and 31 deletions
|
@ -1,3 +1,4 @@
|
||||||
|
import hashlib
|
||||||
import random
|
import random
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
|
@ -6,7 +7,6 @@ from django.core.exceptions import ObjectDoesNotExist
|
||||||
from django.db.models import Q
|
from django.db.models import Q
|
||||||
from django.http import Http404, HttpResponse, HttpResponseForbidden
|
from django.http import Http404, HttpResponse, HttpResponseForbidden
|
||||||
from django.shortcuts import render, redirect, get_object_or_404
|
from django.shortcuts import render, redirect, get_object_or_404
|
||||||
from django.utils.hashcompat import sha_constructor
|
|
||||||
from django.views import static
|
from django.views import static
|
||||||
|
|
||||||
from django.contrib import messages
|
from django.contrib import messages
|
||||||
|
@ -110,8 +110,8 @@ def proposal_speaker_manage(request, pk):
|
||||||
Q(user=None, invite_email=email_address)
|
Q(user=None, invite_email=email_address)
|
||||||
)
|
)
|
||||||
except Speaker.DoesNotExist:
|
except Speaker.DoesNotExist:
|
||||||
salt = sha_constructor(str(random.random())).hexdigest()[:5]
|
salt = hashlib.sha1(str(random.random())).hexdigest()[:5]
|
||||||
token = sha_constructor(salt + email_address).hexdigest()
|
token = hashlib.sha1(salt + email_address).hexdigest()
|
||||||
pending = Speaker.objects.create(
|
pending = Speaker.objects.create(
|
||||||
invite_email=email_address,
|
invite_email=email_address,
|
||||||
invite_token=token,
|
invite_token=token,
|
||||||
|
|
Loading…
Reference in a new issue