fix bandit error (SHA1 has to be used)
This commit is contained in:
parent
10d6a30f2c
commit
b8694a7ade
|
@ -25,7 +25,7 @@ class HaveIBeenPwendPolicy(Policy):
|
||||||
if not hasattr(user, '__password__'):
|
if not hasattr(user, '__password__'):
|
||||||
return True
|
return True
|
||||||
password = getattr(user, '__password__')
|
password = getattr(user, '__password__')
|
||||||
pw_hash = sha1(password.encode('utf-8')).hexdigest()
|
pw_hash = sha1(password.encode('utf-8')).hexdigest() # nosec
|
||||||
url = 'https://api.pwnedpasswords.com/range/%s' % pw_hash[:5]
|
url = 'https://api.pwnedpasswords.com/range/%s' % pw_hash[:5]
|
||||||
result = get(url).text
|
result = get(url).text
|
||||||
final_count = 0
|
final_count = 0
|
||||||
|
|
Reference in New Issue