django-defender/defender/tasks.py
Aleksi Häkli a1d526f318
PEP8 formatting (#147)
Run black with Python 2.7 as target version
to unify the code styling and make it more
linter and style guide compliant
2019-11-15 20:22:14 +02:00

16 lines
488 B
Python

from .data import store_login_attempt
# not sure how to get this to look better. ideally we want to dynamically
# apply the celery decorator based on the USE_CELERY setting.
from celery import shared_task
@shared_task()
def add_login_attempt_task(
user_agent, ip_address, username, http_accept, path_info, login_valid
):
""" Create a record for the login attempt """
store_login_attempt(
user_agent, ip_address, username, http_accept, path_info, login_valid
)