diff options
author | Nico von Geyso <Nico.Geyso@FU-Berlin.de> | 2012-09-26 21:22:12 +0200 |
---|---|---|
committer | Nico von Geyso <Nico.Geyso@FU-Berlin.de> | 2012-09-26 21:22:12 +0200 |
commit | c2b60b7e226d1f703d673eea38873a231d676a90 (patch) | |
tree | 322440aefccc9d70973276c00212aa5bd0d1cdcb /account.py | |
parent | 46b043179dfde4043086f16280edb2ca96236214 (diff) | |
download | web-c2b60b7e226d1f703d673eea38873a231d676a90.tar.gz web-c2b60b7e226d1f703d673eea38873a231d676a90.tar.bz2 web-c2b60b7e226d1f703d673eea38873a231d676a90.zip |
added InvalidPasswordError Exception
Diffstat (limited to 'account.py')
-rw-r--r-- | account.py | 6 |
1 files changed, 5 insertions, 1 deletions
@@ -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 |