diff options
| author | Eli Collins <elic@assurancetechnologies.com> | 2011-12-06 16:08:52 -0500 |
|---|---|---|
| committer | Eli Collins <elic@assurancetechnologies.com> | 2011-12-06 16:08:52 -0500 |
| commit | c5ec1f9c49522a357075c9a0353b028f930e04ad (patch) | |
| tree | 936e96672725980be447a6601ca80444a8f36040 /passlib/ext | |
| parent | e2f085dd5606c4c1547803cfcbddd5796009f50f (diff) | |
| download | passlib-c5ec1f9c49522a357075c9a0353b028f930e04ad.tar.gz | |
added compat.unicode imports in a number of places
this distinguishes the types, so that for isinstance() tests...
* 'unicode' always means the unicode type
* 'bytes' always means the bytes type
* 'str' always means the native string type
Diffstat (limited to 'passlib/ext')
| -rw-r--r-- | passlib/ext/django/models.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/passlib/ext/django/models.py b/passlib/ext/django/models.py index 76117bd..b86a796 100644 --- a/passlib/ext/django/models.py +++ b/passlib/ext/django/models.py @@ -16,6 +16,7 @@ from django.conf import settings #pkg from passlib.context import CryptContext, CryptPolicy from passlib.utils import is_crypt_context, bytes +from passlib.utils.compat import sb_types, unicode from passlib.ext.django.utils import DEFAULT_CTX, get_category, \ set_django_password_context @@ -34,7 +35,7 @@ def patch(): return if ctx == "passlib-default": ctx = DEFAULT_CTX - if isinstance(ctx, (unicode, bytes)): + if isinstance(ctx, sb_types): ctx = CryptPolicy.from_string(ctx) if isinstance(ctx, CryptPolicy): ctx = CryptContext(policy=ctx) |
