Commit 02011d8e authored by Cédric Le Ninivin's avatar Cédric Le Ninivin

immediateReindexObject: use super user to reindex script

Reindex result should not vary from one user to another, hence,
reindexation should be done by superuser
parent ae1c3380
...@@ -85,7 +85,7 @@ from Products.ERP5Type.Accessor.Accessor import Accessor as Method ...@@ -85,7 +85,7 @@ from Products.ERP5Type.Accessor.Accessor import Accessor as Method
from Products.ERP5Type.Accessor.TypeDefinition import asDate from Products.ERP5Type.Accessor.TypeDefinition import asDate
from Products.ERP5Type.Message import Message from Products.ERP5Type.Message import Message
from Products.ERP5Type.ConsistencyMessage import ConsistencyMessage from Products.ERP5Type.ConsistencyMessage import ConsistencyMessage
from Products.ERP5Type.UnrestrictedMethod import UnrestrictedMethod from Products.ERP5Type.UnrestrictedMethod import UnrestrictedMethod, super_user
from zope.interface import classImplementsOnly, implementedBy from zope.interface import classImplementsOnly, implementedBy
...@@ -2748,7 +2748,9 @@ class Base( CopyContainer, ...@@ -2748,7 +2748,9 @@ class Base( CopyContainer,
root_indexable = int(getattr(self.getPortalObject(),'isIndexable',1)) root_indexable = int(getattr(self.getPortalObject(),'isIndexable',1))
if self.isIndexable and root_indexable: if self.isIndexable and root_indexable:
#LOG("immediateReindexObject",0,self.getRelativeUrl()) #LOG("immediateReindexObject",0,self.getRelativeUrl())
PortalContent.reindexObject(self, *args, **kw) # Reindex result should not depend on the user
with super_user():
PortalContent.reindexObject(self, *args, **kw)
else: else:
pass pass
#LOG("No reindex now",0,self.getRelativeUrl()) #LOG("No reindex now",0,self.getRelativeUrl())
......
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