Module: deluge Branch: master Commit: 67ff83360f748e0b20fa19967de517b59068d632
Author: Pedro Algarvio <[email protected]> Date: Tue Dec 21 02:54:53 2010 +0000 Use the exceptions from `deluge.errors`. --- deluge/core/authmanager.py | 10 ++-------- 1 files changed, 2 insertions(+), 8 deletions(-) diff --git a/deluge/core/authmanager.py b/deluge/core/authmanager.py index ad1f09d..8ad62b3 100644 --- a/deluge/core/authmanager.py +++ b/deluge/core/authmanager.py @@ -40,7 +40,7 @@ import logging import deluge.component as component import deluge.configmanager as configmanager -import deluge.error +from deluge.error import BadLoginError, AuthenticationRequired log = logging.getLogger(__name__) @@ -51,12 +51,6 @@ AUTH_LEVEL_ADMIN = 10 AUTH_LEVEL_DEFAULT = AUTH_LEVEL_NORMAL -class BadLoginError(deluge.error.DelugeError): - pass - -class PasswordRequired(BadLoginError): - pass - class AuthManager(component.Component): def __init__(self): component.Component.__init__(self, "AuthManager") @@ -108,7 +102,7 @@ class AuthManager(component.Component): # Return the users auth level return auth_level elif not password and self.__auth[username][0]: - raise PasswordRequired("Password is required") + raise AuthenticationRequired("Password is required", username) else: raise BadLoginError("Password does not match") -- You received this message because you are subscribed to the Google Groups "deluge-commit" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/deluge-commit?hl=en.
