[Zope3-checkins] SVN: Zope3/trunk/ #380 : Local Utility don't get correct removed.

Julien Anguenot ja at nuxeo.com
Wed May 18 14:59:46 EDT 2005


Log message for revision 30389:
  #380 : Local Utility don't get correct removed.

Changed:
  U   Zope3/trunk/doc/CHANGES.txt
  U   Zope3/trunk/doc/TODO.txt
  U   Zope3/trunk/src/zope/app/container/dependency.py

-=-
Modified: Zope3/trunk/doc/CHANGES.txt
===================================================================
--- Zope3/trunk/doc/CHANGES.txt	2005-05-18 18:43:58 UTC (rev 30388)
+++ Zope3/trunk/doc/CHANGES.txt	2005-05-18 18:59:46 UTC (rev 30389)
@@ -591,6 +591,8 @@
 
     Bug Fixes
 
+      - Fixed issue #380: Local Utility don't get correct removed
+
       - Fixed issue #369: DAV is broken on the trunk.
 
       - Fixed issue #407: zope.app.publication.http.MethodNotAllowed.__str__:

Modified: Zope3/trunk/doc/TODO.txt
===================================================================
--- Zope3/trunk/doc/TODO.txt	2005-05-18 18:43:58 UTC (rev 30388)
+++ Zope3/trunk/doc/TODO.txt	2005-05-18 18:59:46 UTC (rev 30389)
@@ -68,8 +68,6 @@
 
   * 373: Adding objects requires permission zope.app.dublincore.change
 
-  * 380: Local Utility don't get correct removed
-
   - 381: Handle migration of site instance 'securitypolicy.zcml' files
 
   * 384: Problems with permissions in zcml utility directives

Modified: Zope3/trunk/src/zope/app/container/dependency.py
===================================================================
--- Zope3/trunk/src/zope/app/container/dependency.py	2005-05-18 18:43:58 UTC (rev 30388)
+++ Zope3/trunk/src/zope/app/container/dependency.py	2005-05-18 18:59:46 UTC (rev 30389)
@@ -11,8 +11,11 @@
 # FOR A PARTICULAR PURPOSE.
 #
 ##############################################################################
-"""Objects that take care of annotating dublin core meta data times
 
+"""Subscriber function checking dependencies if a removal is performed
+on an object having dependencies. It raises an exception if it's the
+case.
+
 $Id$
 """
 __docformat__ = 'restructuredtext'
@@ -20,14 +23,19 @@
 from zope.app import zapi
 from zope.app.dependable.interfaces import IDependable, DependencyError
 
+exception_msg = """
+Removal of object (%s) which has dependents (%s) is not possible !
+
+You must desactivate this object before trying to remove it.
+"""
+
 def CheckDependency(event):
     object = event.object
     dependency = IDependable(object, None)
     if dependency is not None:
         dependents = dependency.dependents()
         if dependents:
-            objectpath = zapi.getPath(event.object)
-            raise DependencyError("Removal of object (%s)"
-                                  " which has dependents (%s)"
+            objectpath = zapi.getPath(object)
+            raise DependencyError(exception_msg
                                   % (objectpath,
                                      ", ".join(dependents)))



More information about the Zope3-Checkins mailing list