[Zope3-checkins] CVS: Zope3/src/zope/app/browser - undo.py:1.3

Jim Fulton jim@zope.com
Mon, 20 Jan 2003 14:59:00 -0500


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

Modified Files:
	undo.py 
Log Message:
Changed the view so that it doesn't get the undo utility until it
needs it.


=== Zope3/src/zope/app/browser/undo.py 1.2 => 1.3 ===
--- Zope3/src/zope/app/browser/undo.py:1.2	Wed Dec 25 09:12:26 2002
+++ Zope3/src/zope/app/browser/undo.py	Mon Jan 20 14:58:57 2003
@@ -53,20 +53,18 @@
 class Undo(BrowserView):
     """Undo View"""
 
-    def __init__(self, *args):
-        super(Undo, self).__init__(*args)
-        self.utility = getUtility(self.context, IUndoManager)
-
     index = ViewPageTemplateFile('undo_log.pt')
 
     def action (self, id_list, REQUEST=None):
         """
         processes undo form and redirects to form again (if possible)
         """
-        self.utility.undoTransaction(id_list)
+        utility = getUtility(self.context, IUndoManager)
+        utility.undoTransaction(id_list)
 
         if REQUEST is not None:
             REQUEST.response.redirect('index.html')
 
     def getUndoInfo(self):
-        return self.utility.getUndoInfo()
+        utility = getUtility(self.context, IUndoManager)
+        return utility.getUndoInfo()