forked from DGNum/gestioCOF
Passage de sha1 à sha256 pour le pwd sur Account
This commit is contained in:
parent
7bfd2e2f9a
commit
d12dfe2f56
|
@ -18,8 +18,8 @@ class KFetBackend(object):
|
||||||
return None
|
return None
|
||||||
|
|
||||||
try:
|
try:
|
||||||
password_sha1 = hashlib.sha1(password.encode()).hexdigest()
|
password_sha256 = hashlib.sha256(password.encode()).hexdigest()
|
||||||
account = Account.objects.get(password=password_sha1)
|
account = Account.objects.get(password=password_sha256)
|
||||||
user = account.cofprofile.user
|
user = account.cofprofile.user
|
||||||
except Account.DoesNotExist:
|
except Account.DoesNotExist:
|
||||||
return None
|
return None
|
||||||
|
|
|
@ -319,9 +319,9 @@ def account_update(request, trigramme):
|
||||||
if (request.user.has_perm('kfet.change_account_password')
|
if (request.user.has_perm('kfet.change_account_password')
|
||||||
and pwd_form.is_valid()):
|
and pwd_form.is_valid()):
|
||||||
pwd = pwd_form.cleaned_data['pwd1']
|
pwd = pwd_form.cleaned_data['pwd1']
|
||||||
pwd_sha1 = hashlib.sha1(pwd.encode()).hexdigest()
|
pwd_sha256 = hashlib.sha256(pwd.encode()).hexdigest()
|
||||||
Account.objects.filter(pk=account.pk).update(
|
Account.objects.filter(pk=account.pk).update(
|
||||||
password = pwd_sha1)
|
password = pwd_sha256)
|
||||||
messages.success(request, 'Mot de passe mis à jour')
|
messages.success(request, 'Mot de passe mis à jour')
|
||||||
|
|
||||||
# Checking perm to manage perms
|
# Checking perm to manage perms
|
||||||
|
|
Loading…
Reference in a new issue