changed session id logic from rand(255) to uuid4 to allow more than 255 answer sets

dj111py38
Jamie Campbell 2015-12-02 01:31:34 -06:00
parent 3d06cd5570
commit 661772bbf9
1 changed files with 3 additions and 1 deletions

View File

@ -27,6 +27,7 @@ import logging
import random
from hashlib import md5
import re
from uuid import uuid4
try:
@ -987,7 +988,8 @@ def generate_run(request, questionnaire_id, subject_id=None):
su = Subject(givenname='Anonymous', surname='User')
su.save()
str_to_hash = "".join(map(lambda i: chr(random.randint(0, 255)), range(16)))
# str_to_hash = "".join(map(lambda i: chr(random.randint(0, 255)), range(16)))
str_to_hash = str(uuid4())
str_to_hash += settings.SECRET_KEY
key = md5(str_to_hash).hexdigest()