~launchpad-pqm/launchpad/devel

« back to all changes in this revision

Viewing changes to lib/lp/registry/browser/distributionsourcepackage.py

  • Committer: Launchpad Patch Queue Manager
  • Date: 2011-08-03 12:42:24 UTC
  • mfrom: (13598.1.1 i-suck)
  • Revision ID: launchpad@pqm.canonical.com-20110803124224-5ddcegazd814zedl
[r=stevenk][no-qa] Fix DistributionSourcePackage:+index
 archive_context_url OOPS when there are no publications.

Show diffs side-by-side

added added

removed removed

Lines of Context:
337
337
        super(DistributionSourcePackageView, self).initialize()
338
338
        expose_structural_subscription_data_to_js(
339
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))
 
340
 
 
341
        pub = self.context.latest_overall_publication
 
342
        if pub:
 
343
            IJSONRequestCache(self.request).objects['archive_context_url'] = (
 
344
                canonical_url(pub.archive, path_only_if_possible=True))
344
345
 
345
346
    @property
346
347
    def label(self):