Commit a97402d3 authored by Aurel's avatar Aurel

authentication : do not use countMessage to prevent race condition

parent ab3ae636
...@@ -67,11 +67,6 @@ if not portal_preferences.isAuthenticationPolicyEnabled() or \\\n ...@@ -67,11 +67,6 @@ if not portal_preferences.isAuthenticationPolicyEnabled() or \\\n
# no policy, no sense to file expire at all or symply system do not configured to\n # no policy, no sense to file expire at all or symply system do not configured to\n
return 0\n return 0\n
\n \n
# Prevent creating 10 recoveries when browser access all HTML, CSS, JS files in parallel\n
tag = "%s_passwd_recovery_inProgress" % context.getUid()\n
if (portal.portal_activities.countMessageWithTag(tag) > 0):\n
return 0\n
\n
# Prevent creating new recovery if one was recently created\n # Prevent creating new recovery if one was recently created\n
recovery_list = portal.portal_catalog(\n recovery_list = portal.portal_catalog(\n
portal_type="Credential Recovery",\n portal_type="Credential Recovery",\n
...@@ -89,6 +84,9 @@ credential_recovery = module.newContent(\n ...@@ -89,6 +84,9 @@ credential_recovery = module.newContent(\n
destination_decision_value=context,\n destination_decision_value=context,\n
language=portal.Localizer.get_selected_language(),\n language=portal.Localizer.get_selected_language(),\n
activate_kw={\'tag\': tag})\n activate_kw={\'tag\': tag})\n
# immediate reindex allowed because it is a new object\n
credential_recovery.immediateReindexObject()\n
context.serialize()\n
credential_recovery.submit()\n credential_recovery.submit()\n
......
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