summaryrefslogtreecommitdiff
path: root/passlib/ext
diff options
context:
space:
mode:
authorEli Collins <elic@assurancetechnologies.com>2012-01-18 20:36:38 -0500
committerEli Collins <elic@assurancetechnologies.com>2012-01-18 20:36:38 -0500
commit6f816a3d7f1f3a394fedcc0aa410792a95b9ece6 (patch)
tree66308581e5b36a60198cd8a0c8b8916ba271eda5 /passlib/ext
parenta4a4d20ec8245f0e2763d08e6f00acbe343c854d (diff)
downloadpasslib-6f816a3d7f1f3a394fedcc0aa410792a95b9ece6.tar.gz
split exceptions/warnings to separate module; added some additional warning classes to make filtering easier
Diffstat (limited to 'passlib/ext')
-rw-r--r--passlib/ext/django/utils.py10
1 files changed, 7 insertions, 3 deletions
diff --git a/passlib/ext/django/utils.py b/passlib/ext/django/utils.py
index fc7c713..be8771c 100644
--- a/passlib/ext/django/utils.py
+++ b/passlib/ext/django/utils.py
@@ -12,6 +12,7 @@
#site
from warnings import warn
#pkg
+from passlib.exc import PasslibRuntimeWarning
from passlib.utils import is_crypt_context
from passlib.utils.compat import bytes, get_method_function as um
#local
@@ -149,13 +150,16 @@ def set_django_password_context(context=None, get_category=get_category):
if state is not None:
if um(User.set_password) is not state['user_set_password']:
warn("another library has patched "
- "django.contrib.auth.models:User.set_password")
+ "django.contrib.auth.models:User.set_password",
+ PasslibRuntimeWarning)
if um(User.check_password) is not state['user_check_password']:
warn("another library has patched"
- "django.contrib.auth.models:User.check_password")
+ "django.contrib.auth.models:User.check_password",
+ PasslibRuntimeWarning)
if _dam.check_password is not state['models_check_password']:
warn("another library has patched"
- "django.contrib.auth.models:check_password")
+ "django.contrib.auth.models:check_password",
+ PasslibRuntimeWarning)
#check if we should just restore original state
if context is None: