diff options
| author | amami <> | 2012-09-14 15:58:07 +0530 |
|---|---|---|
| committer | amami <> | 2012-09-14 15:58:07 +0530 |
| commit | 8d5b4c26e5b875fa3cfcb8d90cbdb2882a06debf (patch) | |
| tree | 69fcf665267a1bb73bf128f9688cbf5dc33c4499 | |
| parent | 4c7638663c0d7d508f60771447a5ee1657174741 (diff) | |
[FIX] Auth_rest_pwd : removed constrain for user_email field. (this has to be chnaged in future as user_email is depricatd field)
bzr revid: amami-20120914102807-afkjduzp9iefog51
| -rw-r--r-- | addons/auth_reset_password/auth_reset_password.py | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/addons/auth_reset_password/auth_reset_password.py b/addons/auth_reset_password/auth_reset_password.py index ab61cb3809d..7aac108795c 100644 --- a/addons/auth_reset_password/auth_reset_password.py +++ b/addons/auth_reset_password/auth_reset_password.py @@ -32,13 +32,10 @@ def message_check(msg, secret): class res_users(osv.osv): _inherit = 'res.users' - _columns = { - 'email': fields.char('Email', size=240), - } - - _sql_constraints = [ - ('email_uniq', 'UNIQUE (email)', 'You can not have two users with the same email!') - ] +# TODO: uesr_email field is dpericated replace user_email with email. +# _sql_constraints = [ +# ('email_uniq', 'UNIQUE (user_email)', 'You can not have two users with the same email!') +# ] def _auth_reset_password_secret(self, cr, uid, context=None): uuid = self.pool.get('ir.config_parameter').get_param(cr, uid, 'database.uuid') @@ -81,7 +78,7 @@ class res_users(osv.osv): MailMessage.send(cr, uid, [msg_id], context=context) def send_reset_password_request(self, cr, uid, email, context=None): - ids = self.pool.get('res.users').search(cr, SUPERUSER_ID, [('email', '=', email)], context=context) + ids = self.pool.get('res.users').search(cr, SUPERUSER_ID, [('user_email', '=', email)], context=context) if ids: self._auth_reset_password_send_email(cr, SUPERUSER_ID, email, 'reset_password_email', ids[0], context=context) return True |
