0001-user_login_failure-pass-identifier-to-smart_bytes-fo.patch
src/authentic2/user_login_failure.py | ||
---|---|---|
2 | 2 |
import hashlib |
3 | 3 | |
4 | 4 |
from django.core.cache import cache |
5 |
from django.utils.encoding import smart_bytes |
|
5 | 6 | |
6 | 7 |
from . import app_settings |
7 | 8 | |
8 | 9 |
def key(identifier): |
9 |
return 'user-login-failure-%s' % hashlib.md5(identifier).hexdigest()
|
|
10 |
return 'user-login-failure-%s' % hashlib.md5(smart_bytes(identifier)).hexdigest()
|
|
10 | 11 | |
11 | 12 |
def user_login_success(identifier): |
12 | 13 |
cache.delete(key(identifier)) |
13 |
- |