1
0
mirror of https://github.com/home-assistant/supervisor.git synced 2025-12-24 04:19:03 +00:00
* fix rate password

* convert int
This commit is contained in:
Pascal Vizeli
2018-02-18 12:18:11 +01:00
committed by GitHub
parent b4d5aeb5d0
commit 699fcdafba
2 changed files with 4 additions and 3 deletions

View File

@@ -19,8 +19,8 @@ def password_for_validating(password):
for _ in range(100):
password = hashlib.sha256(password.encode()).hexdigest()
try:
return sum(map(int, RE_DIGITS.findall(password)))
except ValueError:
return int(str(sum(map(int, RE_DIGITS.findall(password))))[0])
except (ValueError, IndexError):
return 0