Commit 2286a74d authored by Rafael Monnerat's avatar Rafael Monnerat

slapos_erp5: Send proper url and message whenever the Password expire

parent f3e40ba7
Pipeline #18310 passed with stage
in 0 seconds
......@@ -29,8 +29,11 @@ tag = 'credential_recovery_%s' %context.getReference()
if portal.portal_activities.countMessageWithTag(tag):
return
preferred_slapos_web_site_url = context.portal_preference.getPreferredSlaposWebSiteUrl()
if context.getWebSectionValue() is not None:
context.REQUEST.set('came_from', context.getWebSectionValue().absolute_url())
elif preferred_slapos_web_site_url not in ["", None]:
context.REQUEST.set('came_from', preferred_slapos_web_site_url)
module = portal.getDefaultModule(portal_type='Credential Recovery')
credential_recovery = module.newContent(
......@@ -40,4 +43,6 @@ credential_recovery = module.newContent(
language=portal.Localizer.get_selected_language(),
activate_kw={'tag': tag})
context.serialize()
credential_recovery.setDocumentReference('credential_recovery-password-expiration-link')
credential_recovery.submit()
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment