Commit 9d9e4bbc authored by Vincent Pelletier's avatar Vincent Pelletier

ERP5Site: Do reindex the whole site after creation.

Also, drop isIndexable instance property, unmasking class property, which
already has the value we need.
Also, factorise catalog clearing by reusing ERP5Site_reindexAll's.
parent 4b25512d
...@@ -2214,13 +2214,16 @@ class ERP5Generator(PortalGenerator): ...@@ -2214,13 +2214,16 @@ class ERP5Generator(PortalGenerator):
def setupIndex(self, p, **kw): def setupIndex(self, p, **kw):
# Make sure all tools and folders have been indexed # Make sure all tools and folders have been indexed
if kw.get('reindex', 1): if kw.get('reindex', 1):
setattr(p, 'isIndexable', ConstantGetter('isIndexable', value=True)) delattr(p, 'isIndexable')
# Clear portal ids sql table, like this we do not take # Clear portal ids sql table, like this we do not take
# ids for a previously created web site # ids for a previously created web site
p.portal_ids.clearGenerator(all=True) p.portal_ids.clearGenerator(all=True)
# Then clear the catalog and reindex it # Calling ERP5Site_reindexAll is important, as some needed indexation
p.portal_catalog.manage_catalogClear() # activities may have been skipped (not spawned) while portal was tagged
# Calling ERP5Site_reindexAll is useless. # as non-indexable. Maybe not spawning these activities is a bug, in
# which case some bootstrap tricks are needed until portal_activities
# becomes available.
p.ERP5Site_reindexAll(clear_catalog=True)
def setupUserFolder(self, p): def setupUserFolder(self, p):
# Use Pluggable Auth Service instead of the standard acl_users. # Use Pluggable Auth Service instead of the standard acl_users.
......
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