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

Proposed by Michael Hudson-Doyle
Status: Merged
Approved by: Tim Penhey
Approved revision: no longer in the source branch.
Merged at revision: 11259
Proposed branch: lp:~mwhudson/launchpad/kill-launchbag.site
Merge into: lp:launchpad
Diff against target: 62 lines (+2/-14)
3 files modified
lib/canonical/launchpad/webapp/interfaces.py (+0/-1)
lib/canonical/launchpad/webapp/launchbag.py (+1/-6)
lib/canonical/launchpad/webapp/publication.py (+1/-7)
To merge this branch: bzr merge lp:~mwhudson/launchpad/kill-launchbag.site
Reviewer Review Type Date Requested Status
Tim Penhey (community) Approve
Review via email: mp+31348@code.launchpad.net

Commit message

Remove the unused ILaunchBag['site'] attribute

Description of the change

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

To post a comment you must log in.
Revision history for this message
Tim Penhey (thumper) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== 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 @@
304# is very Launchpad-specific. I suggest we split the interface and304# is very Launchpad-specific. I suggest we split the interface and
305# implementation into two parts, having a different name for the webapp/ bits.305# implementation into two parts, having a different name for the webapp/ bits.
306class ILaunchBag(Interface):306class ILaunchBag(Interface):
307 site = Attribute('The application object, or None')
308 person = Attribute('IPerson, or None')307 person = Attribute('IPerson, or None')
309 project = Attribute('IProjectGroup, or None')308 project = Attribute('IProjectGroup, or None')
310 product = Attribute('IProduct, or None')309 product = Attribute('IProduct, or None')
311310
=== 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 @@
21 ISpecification, IBugTask, ILaunchpadCelebrities)21 ISpecification, IBugTask, ILaunchpadCelebrities)
22from canonical.launchpad.webapp.interaction import get_current_principal22from canonical.launchpad.webapp.interaction import get_current_principal
23from canonical.launchpad.webapp.interfaces import (23from canonical.launchpad.webapp.interfaces import (
24 ILaunchBag, ILaunchpadApplication, ILoggedInEvent, IOpenLaunchBag)24 ILaunchBag, ILoggedInEvent, IOpenLaunchBag)
2525
26_utc_tz = pytz.timezone('UTC')26_utc_tz = pytz.timezone('UTC')
2727
@@ -32,7 +32,6 @@
3232
33 # Map Interface to attribute name.33 # Map Interface to attribute name.
34 _registry = {34 _registry = {
35 ILaunchpadApplication: 'site',
36 IPerson: 'person',35 IPerson: 'person',
37 IProjectGroup: 'project',36 IProjectGroup: 'project',
38 IProduct: 'product',37 IProduct: 'product',
@@ -87,10 +86,6 @@
87 store.time_zone = None86 store.time_zone = None
8887
89 @property88 @property
90 def site(self):
91 return self._store.site
92
93 @property
94 def person(self):89 def person(self):
95 return self._store.person90 return self._store.person
9691
9792
=== 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 @@
118 if end_of_traversal_stack == ['+login']:118 if end_of_traversal_stack == ['+login']:
119 return LoginRoot()119 return LoginRoot()
120 else:120 else:
121 bag = getUtility(IOpenLaunchBag)121 return getUtility(self.root_object_interface)
122 if bag.site is None:
123 root_object = getUtility(self.root_object_interface)
124 bag.add(root_object)
125 else:
126 root_object = bag.site
127 return root_object
128122
129 # The below overrides to zopepublication (callTraversalHooks,123 # The below overrides to zopepublication (callTraversalHooks,
130 # afterTraversal, and _maybePlacefullyAuthenticate) make the124 # afterTraversal, and _maybePlacefullyAuthenticate) make the