policies/reputation: only change score when credentials contain username

This commit is contained in:
Jens Langhammer 2020-07-07 22:25:37 +02:00
parent 5644e57e6a
commit 8c500c38b1
1 changed files with 2 additions and 1 deletions

View File

@ -32,6 +32,7 @@ def update_score(request: HttpRequest, username: str, amount: int):
# pylint: disable=unused-argument # pylint: disable=unused-argument
def handle_failed_login(sender, request, credentials, **_): def handle_failed_login(sender, request, credentials, **_):
"""Lower Score for failed loging attempts""" """Lower Score for failed loging attempts"""
if "username" in credentials:
update_score(request, credentials.get("username"), -1) update_score(request, credentials.get("username"), -1)