[Zope3-checkins] CVS: Zope3/src/zope/app/dublincore - creatorannotator.py:1.5.16.2

Marius Gedminas marius at pov.lt
Mon Mar 8 14:29:21 EST 2004


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

Modified Files:
      Tag: mgedmin-events2-branch
	creatorannotator.py 
Log Message:
I've decided that the interaction on security proxies is just a cache, and
therefore security policies should cope with it being None and should use
getInteraction() in that case.  (This policy can become problematic if a
security proxy created in one interaction survives it.  However, if this
policy is changed, then storing interactions in security proxies makes
no sense.)

Also added a missing call to endInteraction in the functional test mechanism.
(I'm really starting to think that endInteraction should never throw) and
some debugging code in newInteraction that helps finding the place where
a "leaked" interaction was created.



=== Zope3/src/zope/app/dublincore/creatorannotator.py 1.5.16.1 => 1.5.16.2 ===
--- Zope3/src/zope/app/dublincore/creatorannotator.py:1.5.16.1	Mon Mar  8 13:43:37 2004
+++ Zope3/src/zope/app/dublincore/creatorannotator.py	Mon Mar  8 14:28:41 2004
@@ -36,9 +36,11 @@
         # Try to find a principal for that one. If there
         # is no principal then we don't touch the list
         # of creators.
-        for principal in getInteraction().principals:
-            principalid = principal.getId()
-            if not principalid in dc.creators:
-                dc.creators = dc.creators + (unicode(principalid), )
+        interaction = getInteraction()
+        if interaction is not None:
+            for principal in interaction.principals:
+                principalid = principal.getId()
+                if not principalid in dc.creators:
+                    dc.creators = dc.creators + (unicode(principalid), )
 
 CreatorAnnotator = CreatorAnnotatorClass()




More information about the Zope3-Checkins mailing list