[Zope3-checkins] CVS: Zope3/src/zope/app/services - registration.py:1.7

Fred L. Drake, Jr. fred@zope.com
Wed, 2 Jul 2003 15:44:03 -0400


Update of /cvs-repository/Zope3/src/zope/app/services
In directory cvs.zope.org:/tmp/cvs-serv7734/src/zope/app/services

Modified Files:
	registration.py 
Log Message:
RegistrationStack.unregsiter(): do not re-activate a registration that is
already active.


=== Zope3/src/zope/app/services/registration.py 1.6 => 1.7 ===
--- Zope3/src/zope/app/services/registration.py:1.6	Wed Jul  2 15:14:58 2003
+++ Zope3/src/zope/app/services/registration.py	Wed Jul  2 15:43:27 2003
@@ -153,19 +153,19 @@
             if data[0] == cid:
                 # Tell it that it is no longer active
                 registration.deactivated()
+                data = data[1:]
+                if data and data[0] is not None:
+                    # Activate the newly active component
+                    sm = zapi.getServiceManager(wrapped_self)
+                    new = zapi.traverse(sm, data[0])
+                    new.activated()
+            else:
+                # Remove it from our data
+                data = tuple([item for item in data if item != cid])
 
-            # Remove it from our data
-            data = tuple([item for item in data if item != cid])
-
-            # Check for trailing None
-            if data and data[-1] is None:
-                data = data[:-1]
-
-            if data and data[0] is not None:
-                # Activate the newly active component
-                sm = zapi.getServiceManager(wrapped_self)
-                new = zapi.traverse(sm, data[0])
-                new.activated()
+                # Check for trailing None
+                if data and data[-1] is None:
+                    data = data[:-1]
 
             # Write data back
             wrapped_self._data = data