Module: deluge Branch: multiuser Commit: fbb3ebe0c74112859e941d0a6304a02657ed945d
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 53ac13b..0362210 100644 --- a/deluge/core/authmanager.py +++ b/deluge/core/authmanager.py @@ -39,7 +39,7 @@ import stat import deluge.component as component import deluge.configmanager as configmanager -import deluge.error +from deluge.error import BadLoginError, AuthenticationRequired from deluge.log import LOG as log @@ -50,12 +50,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") @@ -107,7 +101,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.
