[CMF-checkins] CVS: Products/CMFDefault/skins/zpt_control -
folder_copy_control.py:1.2 folder_cut_control.py:1.2
Yvo Schubbe
y.2004_ at wcm-solutions.de
Thu Aug 19 13:30:45 EDT 2004
Update of /cvs-repository/Products/CMFDefault/skins/zpt_control
In directory cvs.zope.org:/tmp/cvs-serv31297/CMFDefault/skins/zpt_control
Modified Files:
folder_copy_control.py folder_cut_control.py
Log Message:
- catch CopyErrors
=== Products/CMFDefault/skins/zpt_control/folder_copy_control.py 1.1 => 1.2 ===
--- Products/CMFDefault/skins/zpt_control/folder_copy_control.py:1.1 Tue Jul 6 16:34:16 2004
+++ Products/CMFDefault/skins/zpt_control/folder_copy_control.py Thu Aug 19 13:30:44 2004
@@ -1,7 +1,11 @@
##parameters=ids, **kw
##title=Copy objects from a folder to the clipboard
##
-context.manage_copyObjects(ids, context.REQUEST)
+from Products.CMFDefault.exceptions import CopyError
-return context.setStatus( True, 'Item%s copied.' %
- ( len(ids) != 1 and 's' or '' ) )
+try:
+ context.manage_copyObjects(ids, context.REQUEST)
+ return context.setStatus( True, 'Item%s copied.' %
+ ( len(ids) != 1 and 's' or '' ) )
+except CopyError:
+ return context.setStatus(False, 'CopyError: Copy failed.')
=== Products/CMFDefault/skins/zpt_control/folder_cut_control.py 1.1 => 1.2 ===
--- Products/CMFDefault/skins/zpt_control/folder_cut_control.py:1.1 Tue Jul 6 16:34:16 2004
+++ Products/CMFDefault/skins/zpt_control/folder_cut_control.py Thu Aug 19 13:30:44 2004
@@ -1,7 +1,11 @@
##parameters=ids, **kw
##title=Cut objects from a folder and copy to the clipboard
##
-context.manage_cutObjects(ids, context.REQUEST)
+from Products.CMFDefault.exceptions import CopyError
-return context.setStatus( True, 'Item%s cut.' %
- ( len(ids) != 1 and 's' or '' ) )
+try:
+ context.manage_cutObjects(ids, context.REQUEST)
+ return context.setStatus( True, 'Item%s cut.' %
+ ( len(ids) != 1 and 's' or '' ) )
+except CopyError:
+ return context.setStatus(False, 'CopyError: Cut failed.')
More information about the CMF-checkins
mailing list