encode bla...

This commit is contained in:
cmile 2018-10-05 22:02:08 +02:00
parent 3dcd65d7de
commit c7cfe9f719

View file

@ -155,7 +155,7 @@ def gastropin(request):
def calculate_gastro_hash(pin): def calculate_gastro_hash(pin):
key = settings.CBASE_GASTRO_KEY key = settings.CBASE_GASTRO_KEY
bla = '%s%s' % (key, pin) bla = '%s%s' % (key, pin)
return hashlib.sha256(bla).hexdigest() return hashlib.sha256(bla.encode()).hexdigest()
return set_hash_field(request, GastroPinForm, return set_hash_field(request, GastroPinForm,
'gastropin1', 'gastroPIN', calculate_gastro_hash, 'gastropin.html') 'gastropin1', 'gastroPIN', calculate_gastro_hash, 'gastropin.html')