-
-
Notifications
You must be signed in to change notification settings - Fork 143
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #52 from docker-hub/bc
Add helpers that do not assume how to retrieve `username`
- Loading branch information
Showing
3 changed files
with
46 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,14 @@ | ||
from . import config | ||
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. | ||
|
||
if config.USE_CELERY: | ||
from celery import shared_task | ||
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) | ||
|
||
@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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters