Skip to content
Snippets Groups Projects
Commit aae980b4 authored by Olivier Dony's avatar Olivier Dony
Browse files

[FIX] auth_signup: initial invitation link should not expire

parent 8bb5b867
No related branches found
No related tags found
No related merge requests found
......@@ -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')
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment