[ADD]:Added Upstream patch for auth_signup
This commit is contained in:
parent
cb0640a320
commit
21211564c3
@ -78,6 +78,8 @@ class AuthSignupHome(Home):
|
|||||||
login, request.env.user.login, request.httprequest.remote_addr)
|
login, request.env.user.login, request.httprequest.remote_addr)
|
||||||
request.env['res.users'].sudo().reset_password(login)
|
request.env['res.users'].sudo().reset_password(login)
|
||||||
qcontext['message'] = _("An email has been sent with credentials to reset your password")
|
qcontext['message'] = _("An email has been sent with credentials to reset your password")
|
||||||
|
except UserError as e:
|
||||||
|
qcontext['error'] = e.name or e.value
|
||||||
except SignupError:
|
except SignupError:
|
||||||
qcontext['error'] = _("Could not reset your password")
|
qcontext['error'] = _("Could not reset your password")
|
||||||
_logger.exception('error when resetting password')
|
_logger.exception('error when resetting password')
|
||||||
|
@ -45,6 +45,9 @@
|
|||||||
</div>
|
</div>
|
||||||
<div style="padding:0px;width:600px;margin:auto; margin-top: 10px; background: #fff repeat top /100%;color:#777777">
|
<div style="padding:0px;width:600px;margin:auto; margin-top: 10px; background: #fff repeat top /100%;color:#777777">
|
||||||
${user.signature | safe}
|
${user.signature | safe}
|
||||||
|
<p style="font-size: 11px; margin-top: 10px;">
|
||||||
|
<strong>Sent by ${user.company_id.name} using <a href="www.flectrahq.com" style="text-decoration:none; color: #875A7B;">Flectra</a></strong>
|
||||||
|
</p>
|
||||||
</div>]]></field>
|
</div>]]></field>
|
||||||
<field name="user_signature" eval="False"/>
|
<field name="user_signature" eval="False"/>
|
||||||
</record>
|
</record>
|
||||||
@ -81,6 +84,9 @@
|
|||||||
</div>
|
</div>
|
||||||
<div style="padding:0px;width:600px;margin:auto; margin-top: 10px; background: #fff repeat top /100%;color:#777777">
|
<div style="padding:0px;width:600px;margin:auto; margin-top: 10px; background: #fff repeat top /100%;color:#777777">
|
||||||
${user.signature | safe}
|
${user.signature | safe}
|
||||||
|
<p style="font-size: 11px; margin-top: 10px;">
|
||||||
|
<strong>Sent by ${user.company_id.name} using <a href="www.flectrahq.com" style="text-decoration:none; color: #875A7B;">Flectra</a></strong>
|
||||||
|
</p>
|
||||||
</div>]]></field>
|
</div>]]></field>
|
||||||
<field name="user_signature" eval="False"/>
|
<field name="user_signature" eval="False"/>
|
||||||
</record>
|
</record>
|
||||||
@ -122,6 +128,9 @@
|
|||||||
</div>
|
</div>
|
||||||
<div style="padding:0px;width:600px;margin:auto; margin-top: 10px; background: #fff repeat top /100%;color:#777777">
|
<div style="padding:0px;width:600px;margin:auto; margin-top: 10px; background: #fff repeat top /100%;color:#777777">
|
||||||
${user.signature | safe}
|
${user.signature | safe}
|
||||||
|
<p style="font-size: 11px; margin-top: 10px;">
|
||||||
|
<strong>Sent by ${user.company_id.name} using <a href="www.flectrahq.com" style="text-decoration:none; color: #875A7B;">Flectra</a></strong>
|
||||||
|
</p>
|
||||||
</div></field>
|
</div></field>
|
||||||
<field name="user_signature" eval="False"/>
|
<field name="user_signature" eval="False"/>
|
||||||
</record>
|
</record>
|
||||||
|
@ -32,6 +32,7 @@ class ResPartner(models.Model):
|
|||||||
signup_url = fields.Char(compute='_compute_signup_url', string='Signup URL')
|
signup_url = fields.Char(compute='_compute_signup_url', string='Signup URL')
|
||||||
|
|
||||||
@api.multi
|
@api.multi
|
||||||
|
@api.depends('signup_token', 'signup_expiration')
|
||||||
def _compute_signup_valid(self):
|
def _compute_signup_valid(self):
|
||||||
dt = now()
|
dt = now()
|
||||||
for partner in self:
|
for partner in self:
|
||||||
|
@ -155,5 +155,5 @@ class ResUsers(models.Model):
|
|||||||
sup = super(ResUsers, self)
|
sup = super(ResUsers, self)
|
||||||
if not default or not default.get('email'):
|
if not default or not default.get('email'):
|
||||||
# avoid sending email to the user we are duplicating
|
# avoid sending email to the user we are duplicating
|
||||||
sup = super(ResUsers, self.with_context(reset_password=False))
|
sup = super(ResUsers, self.with_context(no_reset_password=True))
|
||||||
return sup.copy(default=default)
|
return sup.copy(default=default)
|
||||||
|
Loading…
Reference in New Issue
Block a user