From 1b65390179f149ffe28cfc77b0a910a43f9ccea6 Mon Sep 17 00:00:00 2001 From: Antony Lesuisse Date: Mon, 7 Jun 2010 18:16:36 +0200 Subject: [PATCH] cleanup exception without traceback bzr revid: al@openerp.com-20100607161636-6bezdwe8e0d187xi --- bin/service/security.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/bin/service/security.py b/bin/service/security.py index c74ed2c7aba..9a9c33984c2 100644 --- a/bin/service/security.py +++ b/bin/service/security.py @@ -22,12 +22,11 @@ import pooler import tools -# When rejecting a password, we need to give as little info as possible +# When rejecting a password, hide the traceback class ExceptionNoTb(Exception): - def __init__(self, msg ): - # self.message = msg # No need in Python 2.6 + def __init__(self, msg): + super(ExceptionNoTb, self).__init__(msg) self.traceback = ('','','') - self.args = (msg, '') def login(db, login, password): pool = pooler.get_pool(db) @@ -38,7 +37,7 @@ def check_super(passwd): if passwd == tools.config['admin_passwd']: return True else: - raise ExceptionNoTb('AccessDenied') + raise ExceptionNoTb('AccessDenied: Invalid super administrator password.') def check(db, uid, passwd): pool = pooler.get_pool(db)