Commit b8aa5933 authored by Vincent Pelletier's avatar Vincent Pelletier

Reduce brokenness.

Putting an uid in "ids" list is plain broken, and a no-op here -> removed.
Use pop() instead of __getitem__ + __delitem__ .
Don't access possibly empty (and unrelated !) "ids" list in error message.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@45829 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 4c65e739
......@@ -217,22 +217,19 @@ class CopyContainer:
if len(ids) > 0:
# Use default method
return ObjectManager.manage_delObjects(self, ids, REQUEST)
if isinstance(uids, (str, int)):
ids=[uids]
if not uids:
return MessageDialog(title='No items specified',
message='No items were specified!',
action ='./manage_main',)
while uids:
uid=uids[-1]
uid = uids.pop()
ob=self.getPortalObject().portal_catalog.getObject(uid)
container = ob.aq_inner.aq_parent
id = ob.id
v=container._getOb(id, self)
if v is self:
raise BadRequest('%s does not exist' % ids[-1])
raise BadRequest('%s does not exist' % id)
container._delObject(id)
del uids[-1]
if REQUEST is not None:
return self.manage_main(self, REQUEST, update_menu=1)
......
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