Commit f8ac430a authored by Julien Muchembled's avatar Julien Muchembled

Fix 2 bugs about default reindexing parameters

- do not alter default parameters when accessing them
- make explicit parameters take precedence over default,
  similarly to activate_kw
parent e7bcf7ea
...@@ -2737,14 +2737,12 @@ class Base( CopyContainer, ...@@ -2737,14 +2737,12 @@ class Base( CopyContainer,
reindex_kw = self.getDefaultReindexParameterDict() reindex_kw = self.getDefaultReindexParameterDict()
if reindex_kw is not None: if reindex_kw is not None:
reindex_activate_kw = reindex_kw.pop('activate_kw', None) reindex_kw = reindex_kw.copy()
if reindex_activate_kw is not None: reindex_activate_kw = reindex_kw.pop('activate_kw', None) or {}
reindex_activate_kw = reindex_activate_kw.copy() reindex_activate_kw.update(activate_kw)
if activate_kw is not None: reindex_kw.update(kw)
# activate_kw parameter takes precedence kw = reindex_kw
reindex_activate_kw.update(activate_kw) activate_kw = reindex_activate_kw
activate_kw = reindex_activate_kw
kw.update(reindex_kw)
group_id_list = [] group_id_list = []
if kw.get("group_id", "") not in ('', None): if kw.get("group_id", "") not in ('', None):
......
...@@ -1291,14 +1291,12 @@ class Folder(CopyContainer, CMFBTreeFolder, CMFHBTreeFolder, Base, FolderMixIn): ...@@ -1291,14 +1291,12 @@ class Folder(CopyContainer, CMFBTreeFolder, CMFHBTreeFolder, Base, FolderMixIn):
reindex_kw = self.getDefaultReindexParameterDict() reindex_kw = self.getDefaultReindexParameterDict()
if reindex_kw is not None: if reindex_kw is not None:
reindex_activate_kw = reindex_kw.pop('activate_kw', None) reindex_kw = reindex_kw.copy()
if reindex_activate_kw is not None: reindex_activate_kw = reindex_kw.pop('activate_kw', None) or {}
reindex_activate_kw = reindex_activate_kw.copy() reindex_activate_kw.update(activate_kw)
if activate_kw is not None: reindex_kw.update(kw)
# activate_kw parameter takes precedence kw = reindex_kw
reindex_activate_kw.update(activate_kw) activate_kw = reindex_activate_kw
activate_kw = reindex_activate_kw
kw.update(reindex_kw)
group_id_list = [] group_id_list = []
if kw.get("group_id", "") not in ('', None): if kw.get("group_id", "") not in ('', None):
......
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