Commit 406ee287 authored by Kazuhiko Shiozaki's avatar Kazuhiko Shiozaki

* FolderMixIn.searchFolder(): warn if DomainSelection instance is passed.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@13117 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent f5260d0e
...@@ -52,6 +52,7 @@ from random import randint ...@@ -52,6 +52,7 @@ from random import randint
import os import os
from zLOG import LOG, PROBLEM from zLOG import LOG, PROBLEM
import warnings
# Dummy Functions for update / upgrade # Dummy Functions for update / upgrade
def dummyFilter(object,REQUEST=None): def dummyFilter(object,REQUEST=None):
...@@ -217,10 +218,20 @@ class FolderMixIn(ExtensionClass.Base): ...@@ -217,10 +218,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