← Back to team overview

launchpad-reviewers team mailing list archive

[Merge] lp:~mwhudson/launchpad/kill-launchbag.site into lp:launchpad/devel

 

Michael Hudson has proposed merging lp:~mwhudson/launchpad/kill-launchbag.site into lp:launchpad/devel.

Requested reviews:
  Launchpad code reviewers (launchpad-reviewers)


Hi,

This branch removes the caching of the root object in the LaunchBag.  Nothing seems to use it -- I've run the tests through ec2 and they passed.

Cheers,
mwh
-- 
https://code.launchpad.net/~mwhudson/launchpad/kill-launchbag.site/+merge/31348
Your team Launchpad code reviewers is requested to review the proposed merge of lp:~mwhudson/launchpad/kill-launchbag.site into lp:launchpad/devel.
=== modified file 'lib/canonical/launchpad/webapp/interfaces.py'
--- lib/canonical/launchpad/webapp/interfaces.py	2010-07-21 08:15:57 +0000
+++ lib/canonical/launchpad/webapp/interfaces.py	2010-07-30 04:08:46 +0000
@@ -304,7 +304,6 @@
 # is very Launchpad-specific. I suggest we split the interface and
 # implementation into two parts, having a different name for the webapp/ bits.
 class ILaunchBag(Interface):
-    site = Attribute('The application object, or None')
     person = Attribute('IPerson, or None')
     project = Attribute('IProjectGroup, or None')
     product = Attribute('IProduct, or None')

=== modified file 'lib/canonical/launchpad/webapp/launchbag.py'
--- lib/canonical/launchpad/webapp/launchbag.py	2010-07-09 12:07:59 +0000
+++ lib/canonical/launchpad/webapp/launchbag.py	2010-07-30 04:08:46 +0000
@@ -21,7 +21,7 @@
         ISpecification, IBugTask, ILaunchpadCelebrities)
 from canonical.launchpad.webapp.interaction import get_current_principal
 from canonical.launchpad.webapp.interfaces import (
-    ILaunchBag, ILaunchpadApplication, ILoggedInEvent, IOpenLaunchBag)
+    ILaunchBag, ILoggedInEvent, IOpenLaunchBag)
 
 _utc_tz = pytz.timezone('UTC')
 
@@ -32,7 +32,6 @@
 
     # Map Interface to attribute name.
     _registry = {
-        ILaunchpadApplication: 'site',
         IPerson: 'person',
         IProjectGroup: 'project',
         IProduct: 'product',
@@ -87,10 +86,6 @@
         store.time_zone = None
 
     @property
-    def site(self):
-        return self._store.site
-
-    @property
     def person(self):
         return self._store.person
 

=== modified file 'lib/canonical/launchpad/webapp/publication.py'
--- lib/canonical/launchpad/webapp/publication.py	2010-07-21 21:03:59 +0000
+++ lib/canonical/launchpad/webapp/publication.py	2010-07-30 04:08:46 +0000
@@ -118,13 +118,7 @@
         if end_of_traversal_stack == ['+login']:
             return LoginRoot()
         else:
-            bag = getUtility(IOpenLaunchBag)
-            if bag.site is None:
-                root_object = getUtility(self.root_object_interface)
-                bag.add(root_object)
-            else:
-                root_object = bag.site
-            return root_object
+            return getUtility(self.root_object_interface)
 
     # The below overrides to zopepublication (callTraversalHooks,
     # afterTraversal, and _maybePlacefullyAuthenticate) make the