[FIX] users_ldap to use new exceptions
bzr revid: al@openerp.com-20111022151535-44c124ymzs7kd1wx
This commit is contained in:
@@ -22,10 +22,11 @@ from osv import fields, osv
|
||||
import pooler
|
||||
import tools
|
||||
import logging
|
||||
from service import security
|
||||
import ldap
|
||||
from ldap.filter import filter_format
|
||||
|
||||
import openerp.exceptions
|
||||
|
||||
|
||||
class CompanyLDAP(osv.osv):
|
||||
_name = 'res.company.ldap'
|
||||
@@ -148,12 +149,12 @@ class users(osv.osv):
|
||||
def check(self, db, uid, passwd):
|
||||
try:
|
||||
return super(users,self).check(db, uid, passwd)
|
||||
except security.ExceptionNoTb: # AccessDenied
|
||||
except openerp.exceptions.AccessDenied:
|
||||
pass
|
||||
|
||||
if not passwd:
|
||||
# empty passwords disallowed for obvious security reasons
|
||||
raise security.ExceptionNoTb('AccessDenied')
|
||||
raise openerp.exceptions.AccessDenied()
|
||||
|
||||
cr = pooler.get_db(db).cursor()
|
||||
user = self.browse(cr, 1, uid)
|
||||
@@ -187,7 +188,7 @@ class users(osv.osv):
|
||||
logger.warning('cannot check', exc_info=True)
|
||||
pass
|
||||
cr.close()
|
||||
raise security.ExceptionNoTb('AccessDenied')
|
||||
raise openerp.exceptions.AccessDenied()
|
||||
|
||||
users()
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
|
||||
Reference in New Issue
Block a user