Merge lp:~wgrant/launchpad/fix-dsp-index into lp:launchpad

Proposed by William Grant
Status: Merged
Approved by: William Grant
Approved revision: no longer in the source branch.
Merged at revision: 13596
Proposed branch: lp:~wgrant/launchpad/fix-dsp-index
Merge into: lp:launchpad
Diff against target: 35 lines (+5/-2)
2 files modified
lib/lp/registry/browser/distributionsourcepackage.py (+5/-0)
lib/lp/registry/templates/distributionsourcepackage-index.pt (+0/-2)
To merge this branch: bzr merge lp:~wgrant/launchpad/fix-dsp-index
Reviewer Review Type Date Requested Status
Steve Kowalik (community) code Approve
Review via email: mp+70249@code.launchpad.net

Commit message

Fix DSP:+index expanders by using IJSONRequestCache instead of touching LP.cache directly.

Description of the change

Make DSP:+index use IJSONRequestCache rather than manipulating LP.cache directly. That doesn't work since r13548, which changes base-layout to clobber LP.cache rather than just setting the relevant entries.

To post a comment you must log in.
Revision history for this message
Steve Kowalik (stevenk) :
review: Approve (code)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'lib/lp/registry/browser/distributionsourcepackage.py'
2--- lib/lp/registry/browser/distributionsourcepackage.py 2011-07-28 17:34:34 +0000
3+++ lib/lp/registry/browser/distributionsourcepackage.py 2011-08-03 04:53:24 +0000
4@@ -21,6 +21,7 @@
5 import operator
6
7 from lazr.delegates import delegates
8+from lazr.restful.interfaces import IJSONRequestCache
9 import pytz
10 from zope.component import (
11 adapter,
12@@ -336,6 +337,10 @@
13 super(DistributionSourcePackageView, self).initialize()
14 expose_structural_subscription_data_to_js(
15 self.context, self.request, self.user)
16+ IJSONRequestCache(self.request).objects['archive_context_url'] = (
17+ canonical_url(
18+ self.context.latest_overall_publication.archive,
19+ path_only_if_possible=True))
20
21 @property
22 def label(self):
23
24=== modified file 'lib/lp/registry/templates/distributionsourcepackage-index.pt'
25--- lib/lp/registry/templates/distributionsourcepackage-index.pt 2011-07-15 11:18:47 +0000
26+++ lib/lp/registry/templates/distributionsourcepackage-index.pt 2011-08-03 04:53:24 +0000
27@@ -188,8 +188,6 @@
28
29 </tal:rows>
30 </table>
31- <script
32- tal:content="string:LP.cache['archive_context_url'] = '${archive/fmt:url}';"></script>
33 <metal:js use-macro="archive/@@+macros/expandable-table-js"/>
34
35 </div>