From c2b60b7e226d1f703d673eea38873a231d676a90 Mon Sep 17 00:00:00 2001 From: Nico von Geyso Date: Wed, 26 Sep 2012 21:22:12 +0200 Subject: added InvalidPasswordError Exception --- account.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/account.py b/account.py index bd5281a..8231122 100644 --- a/account.py +++ b/account.py @@ -258,7 +258,8 @@ class AccountService: if self.admin: self.connection.passwd_s(dn, None, new) else: - self.connection.passwd_s(dn, old, new) + try: self.connection.passwd_s(dn, old, new) + except: raise InvalidPasswordError() account.password = new @@ -337,3 +338,6 @@ class Account: class NoSuchUserError(ValueError): pass + +class InvalidPasswordError(ldap.INVALID_CREDENTIALS): + pass -- cgit v1.2.3-1-g7c22