diff options
| author | Eli Collins <elic@assurancetechnologies.com> | 2020-03-28 18:34:24 -0400 |
|---|---|---|
| committer | Eli Collins <elic@assurancetechnologies.com> | 2020-03-28 18:34:24 -0400 |
| commit | ad36df92db4464e0a08e2fc2bc8a1ca9485858b7 (patch) | |
| tree | 405f4505c377a4700a8588800e25a65530509df7 /passlib/ext | |
| parent | dd552a8df1ddf04f591c523d0a8edd62c5e9b77f (diff) | |
| download | passlib-ad36df92db4464e0a08e2fc2bc8a1ca9485858b7.tar.gz | |
passlib.ext.django: fix import that was removed in django 3
Diffstat (limited to 'passlib/ext')
| -rw-r--r-- | passlib/ext/django/utils.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/passlib/ext/django/utils.py b/passlib/ext/django/utils.py index a83cb89..1d1bd67 100644 --- a/passlib/ext/django/utils.py +++ b/passlib/ext/django/utils.py @@ -447,7 +447,10 @@ class DjangoContextAdapter(DjangoTranslator): self.get_user_category = get_user_category # install lru cache wrappers - from django.utils.lru_cache import lru_cache + try: + from functools import lru_cache # new py32 + except ImportError: + from django.utils.lru_cache import lru_cache # py2 compat, removed in django 3 (or earlier?) self.get_hashers = lru_cache()(self.get_hashers) # get copy of original make_password |
