diff options
| author | Olivier Dony <odo@openerp.com> | 2015-11-10 10:35:23 +0100 |
|---|---|---|
| committer | Olivier Dony <odo@openerp.com> | 2015-11-10 10:35:41 +0100 |
| commit | aae980b458f6f8807e2dd5d6122d33a7b2c21480 (patch) | |
| tree | 0539f7bb7656e0fe80fb133dcc867c01e7347c34 /addons | |
| parent | 8bb5b867db3a976226f931206a8248638086f4b8 (diff) | |
[FIX] auth_signup: initial invitation link should not expire
Diffstat (limited to 'addons')
| -rw-r--r-- | addons/auth_signup/res_users.py | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/addons/auth_signup/res_users.py b/addons/auth_signup/res_users.py index eab3fbe9877..4b99259a8a9 100644 --- a/addons/auth_signup/res_users.py +++ b/addons/auth_signup/res_users.py @@ -256,16 +256,21 @@ class res_users(osv.Model): def action_reset_password(self, cr, uid, ids, context=None): """ create signup token for each user, and send their signup url by email """ # prepare reset password signup + create_mode = bool(context.get('create_user')) res_partner = self.pool.get('res.partner') partner_ids = [user.partner_id.id for user in self.browse(cr, uid, ids, context)] - res_partner.signup_prepare(cr, uid, partner_ids, signup_type="reset", expiration=now(days=+1), context=context) + + # no time limit for initial invitation, only for reset password + expiration = False if create_mode else now(days=+1) + + res_partner.signup_prepare(cr, uid, partner_ids, signup_type="reset", expiration=expiration, context=context) if not context: context = {} # send email to users with their signup url template = False - if context.get('create_user'): + if create_mode: try: # get_object() raises ValueError if record does not exist template = self.pool.get('ir.model.data').get_object(cr, uid, 'auth_signup', 'set_password_email') |
