From 070c8f949dc01da8b515a420c98e0f989a39bc3a Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Aur=C3=A9lien=20Calonne?= <aurel@nexedi.com>
Date: Wed, 16 Dec 2015 09:10:28 +0100
Subject: [PATCH] authentication : reindex immediately

Person_isPasswordExpired cache the wrong result if document is not in catalog
---
 .../scripts/Person_changePassword.xml                          | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/bt5/erp5_authentication_policy/WorkflowTemplateItem/portal_workflow/password_interaction_workflow/scripts/Person_changePassword.xml b/bt5/erp5_authentication_policy/WorkflowTemplateItem/portal_workflow/password_interaction_workflow/scripts/Person_changePassword.xml
index bececc8c92..d9f1e43f9f 100644
--- a/bt5/erp5_authentication_policy/WorkflowTemplateItem/portal_workflow/password_interaction_workflow/scripts/Person_changePassword.xml
+++ b/bt5/erp5_authentication_policy/WorkflowTemplateItem/portal_workflow/password_interaction_workflow/scripts/Person_changePassword.xml
@@ -66,6 +66,9 @@ if number_of_last_password_to_check is not None and number_of_last_password_to_c
                                                            destination_value = person,\n
                                                            password = current_password)\n
     password_event.confirm()\n
+    # Person_isPasswordExpired cache the wrong result if document is not in catalog.\n
+    # As the document is created in the same transaction, it is possible to force reindexation\n
+    password_event.immediateReindexObject()\n
 </string> </value>
         </item>
         <item>
-- 
2.30.9