all: implement black as code formatter

This commit is contained in:
Jens Langhammer
2019-12-31 12:51:16 +01:00
parent 8eb3f0f708
commit 3bd1eadd51
298 changed files with 4825 additions and 3145 deletions

View File

@ -12,7 +12,7 @@ LOGGER = get_logger()
def update_score(request, username, amount):
"""Update score for IP and User"""
remote_ip = get_client_ip(request) or '255.255.255.255.'
remote_ip = get_client_ip(request) or "255.255.255.255."
ip_score, _ = IPReputation.objects.update_or_create(ip=remote_ip)
ip_score.score += amount
ip_score.save()
@ -30,7 +30,7 @@ def update_score(request, username, amount):
# pylint: disable=unused-argument
def handle_failed_login(sender, request, credentials, **_):
"""Lower Score for failed loging attempts"""
update_score(request, credentials.get('username'), -1)
update_score(request, credentials.get("username"), -1)
@receiver(user_logged_in)