Fix encodage password
This commit is contained in:
parent
58cb6015fc
commit
5569b7d154
2 changed files with 2 additions and 2 deletions
|
@ -18,7 +18,7 @@ class KFetBackend(object):
|
|||
return None
|
||||
|
||||
try:
|
||||
password_sha256 = hashlib.sha256(password.encode()).hexdigest()
|
||||
password_sha256 = hashlib.sha256(password.encode('utf-8')).hexdigest()
|
||||
account = Account.objects.get(password=password_sha256)
|
||||
user = account.cofprofile.user
|
||||
except Account.DoesNotExist:
|
||||
|
|
|
@ -399,7 +399,7 @@ def account_update(request, trigramme):
|
|||
if (request.user.has_perm('kfet.change_account_password')
|
||||
and pwd_form.is_valid()):
|
||||
pwd = pwd_form.cleaned_data['pwd1']
|
||||
pwd_sha256 = hashlib.sha256(pwd.encode()).hexdigest()
|
||||
pwd_sha256 = hashlib.sha256(pwd.encode('utf-8')).hexdigest()
|
||||
Account.objects.filter(pk=account.pk).update(
|
||||
password = pwd_sha256)
|
||||
messages.success(request, 'Mot de passe mis à jour')
|
||||
|
|
Loading…
Reference in a new issue