Browse Source

[FIX] res_config.py : incorrect call. self.pool('xxx') -> self.pool['xxx']

[REF] res_users.py : same call to self.pool in other res_users class.
pull/2/head
Sylvain LE GAL 11 years ago
parent
commit
61cac54371
  1. 8
      auth_admin_passkey/model/res_config.py
  2. 6
      auth_admin_passkey/model/res_users.py

8
auth_admin_passkey/model/res_config.py

@ -13,7 +13,7 @@ class base_config_settings(TransientModel):
### Getter / Setter Section
def get_default_auth_admin_passkey_send_to_admin(self, cr, uid, ids,
context=None):
icp = self.pool('ir.config_parameter')
icp = self.pool['ir.config_parameter']
return {
'auth_admin_passkey_send_to_admin' : safe_eval(icp.get_param(cr,
uid, 'auth_admin_passkey.send_to_admin', 'True')),
@ -21,13 +21,13 @@ class base_config_settings(TransientModel):
def set_auth_admin_passkey_send_to_admin(self, cr, uid, ids, context=None):
config = self.browse(cr, uid, ids[0], context=context)
icp = self.pool('ir.config_parameter')
icp = self.pool['ir.config_parameter']
icp.set_param(cr, uid, 'auth_admin_passkey.send_to_admin',
repr(config.auth_admin_passkey_send_to_admin))
def get_default_auth_admin_passkey_send_to_user(self, cr, uid, ids,
context=None):
icp = self.pool('ir.config_parameter')
icp = self.pool['ir.config_parameter']
return {
'auth_admin_passkey_send_to_user' : safe_eval(icp.get_param(cr,
uid, 'auth_admin_passkey.send_to_user', 'True')),
@ -35,7 +35,7 @@ class base_config_settings(TransientModel):
def set_auth_admin_passkey_send_to_user(self, cr, uid, ids, context=None):
config = self.browse(cr, uid, ids[0], context=context)
icp = self.pool('ir.config_parameter')
icp = self.pool['ir.config_parameter']
icp.set_param(cr, uid, 'auth_admin_passkey.send_to_user',
repr(config.auth_admin_passkey_send_to_user))

6
auth_admin_passkey/model/res_users.py

@ -24,8 +24,8 @@ class res_users(Model):
""" Send a email to the admin of the system and / or the user
to inform passkey use """
mails = []
mail_obj = self.pool.get('mail.mail')
icp_obj = self.pool.get('ir.config_parameter')
mail_obj = self.pool['mail.mail']
icp_obj = self.pool['ir.config_parameter']
admin_user = self.browse(cr, SUPERUSER_ID, SUPERUSER_ID)
login_user = self.browse(cr, SUPERUSER_ID, user_id)
send_to_admin = literal_eval(icp_obj.get_param(cr, SUPERUSER_ID,
@ -55,7 +55,7 @@ class res_users(Model):
def _send_email_same_password(self, cr, login_user):
""" Send a email to the admin user to inform that another user has the
same password as him"""
mail_obj = self.pool.get('mail.mail')
mail_obj = self.pool['mail.mail']
admin_user = self.browse(cr, SUPERUSER_ID, SUPERUSER_ID)
if admin_user.email:
mail_obj.create(cr, SUPERUSER_ID, {

Loading…
Cancel
Save