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
=== modified file 'lib/lp/registry/browser/distributionsourcepackage.py'
--- lib/lp/registry/browser/distributionsourcepackage.py 2011-07-28 17:34:34 +0000
+++ lib/lp/registry/browser/distributionsourcepackage.py 2011-08-03 04:53:24 +0000
@@ -21,6 +21,7 @@
21import operator21import operator
2222
23from lazr.delegates import delegates23from lazr.delegates import delegates
24from lazr.restful.interfaces import IJSONRequestCache
24import pytz25import pytz
25from zope.component import (26from zope.component import (
26 adapter,27 adapter,
@@ -336,6 +337,10 @@
336 super(DistributionSourcePackageView, self).initialize()337 super(DistributionSourcePackageView, self).initialize()
337 expose_structural_subscription_data_to_js(338 expose_structural_subscription_data_to_js(
338 self.context, self.request, self.user)339 self.context, self.request, self.user)
340 IJSONRequestCache(self.request).objects['archive_context_url'] = (
341 canonical_url(
342 self.context.latest_overall_publication.archive,
343 path_only_if_possible=True))
339344
340 @property345 @property
341 def label(self):346 def label(self):
342347
=== modified file 'lib/lp/registry/templates/distributionsourcepackage-index.pt'
--- lib/lp/registry/templates/distributionsourcepackage-index.pt 2011-07-15 11:18:47 +0000
+++ lib/lp/registry/templates/distributionsourcepackage-index.pt 2011-08-03 04:53:24 +0000
@@ -188,8 +188,6 @@
188188
189 </tal:rows>189 </tal:rows>
190 </table>190 </table>
191 <script
192 tal:content="string:LP.cache['archive_context_url'] = '${archive/fmt:url}';"></script>
193 <metal:js use-macro="archive/@@+macros/expandable-table-js"/>191 <metal:js use-macro="archive/@@+macros/expandable-table-js"/>
194192
195 </div>193 </div>