Commit 286e45df authored by Łukasz Nowak's avatar Łukasz Nowak

- ids can be only strings, even if passed in list


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@29783 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 5e6c04cd
...@@ -184,14 +184,17 @@ class FolderMixIn(ExtensionClass.Base): ...@@ -184,14 +184,17 @@ class FolderMixIn(ExtensionClass.Base):
""" delete items in this folder. """ delete items in this folder.
`id` can be a list or a string. `id` can be a list or a string.
""" """
error_message = 'deleteContent only accepts string or list of strings not '
if isinstance(id, str): if isinstance(id, str):
self._delObject(id) self._delObject(id)
elif isinstance(id, list) or isinstance(id, tuple): elif isinstance(id, list) or isinstance(id, tuple):
for my_id in id: for my_id in id:
if isinstance(my_id, str):
self._delObject(my_id) self._delObject(my_id)
else: else:
raise TypeError, 'deleteContent only accepts string or list, '\ raise TypeError, error_message + str(type(my_id))
'not %s' % type(id) else:
raise TypeError, error_message + str(type(id))
def _generatePerDayId(self): def _generatePerDayId(self):
""" """
......
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