policies/reputation: only change score when credentials contain username
This commit is contained in:
parent
5644e57e6a
commit
8c500c38b1
|
@ -32,7 +32,8 @@ def update_score(request: HttpRequest, username: str, amount: int):
|
|||
# pylint: disable=unused-argument
|
||||
def handle_failed_login(sender, request, credentials, **_):
|
||||
"""Lower Score for failed loging attempts"""
|
||||
update_score(request, credentials.get("username"), -1)
|
||||
if "username" in credentials:
|
||||
update_score(request, credentials.get("username"), -1)
|
||||
|
||||
|
||||
@receiver(user_logged_in)
|
||||
|
|
Reference in New Issue