Commit 51f69e8c authored by Kazuhiko Shiozaki's avatar Kazuhiko Shiozaki

* passing DomainSelection instance as selection_domain or selection_report is deprecated.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@18231 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 04858648
...@@ -305,10 +305,20 @@ class FolderMixIn(ExtensionClass.Base): ...@@ -305,10 +305,20 @@ class FolderMixIn(ExtensionClass.Base):
# We do not have conflicting parent uid values # We do not have conflicting parent uid values
delete_parent_uid = 0 delete_parent_uid = 0
if kw.has_key('selection_domain'): if kw.has_key('selection_domain'):
if kw['selection_domain'].asDomainDict().has_key('parent'): if not isinstance(kw['selection_domain'], dict):
warnings.warn("To pass a DomainSelection instance is deprecated.\n"
"Please use a domain dict instead.",
DeprecationWarning)
kw['selection_domain'] = kw['selection_domain'].asDomainDict()
if kw['selection_domain'].has_key('parent'):
delete_parent_uid = 1 delete_parent_uid = 1
if kw.has_key('selection_report'): if kw.has_key('selection_report'):
if kw['selection_report'].asDomainDict().has_key('parent'): if not isinstance(kw['selection_report'], dict):
warnings.warn("To pass a DomainSelection instance is deprecated.\n"
"Please use a domain dict instead.",
DeprecationWarning)
kw['selection_report'] = kw['selection_report'].asDomainDict()
if kw['selection_report'].has_key('parent'):
delete_parent_uid = 1 delete_parent_uid = 1
if delete_parent_uid: if delete_parent_uid:
del kw['parent_uid'] del kw['parent_uid']
......
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