Merge lp://staging/~julian-edwards/launchpad/dsp-involvement-bug-420480 into lp://staging/launchpad

Proposed by Julian Edwards
Status: Merged
Merged at revision: not available
Proposed branch: lp://staging/~julian-edwards/launchpad/dsp-involvement-bug-420480
Merge into: lp://staging/launchpad
Diff against target: None lines
To merge this branch: bzr merge lp://staging/~julian-edwards/launchpad/dsp-involvement-bug-420480
Reviewer Review Type Date Requested Status
Abel Deuring (community) Approve
Review via email: mp+10841@code.staging.launchpad.net
To post a comment you must log in.
Revision history for this message
Julian Edwards (julian-edwards) wrote :

= Summary =
Fix involvement menu for DistributionSourcePackage

== Proposed fix ==
The code at lib/lp/registry/browser/pillar.py calculates what kind of
involvement a pillar has. Because it assumes that the pillar is a
distribution for a distributionsourcepackage page, it can activate the
blueprints link which is not applicable to them.

== Pre-implementation notes ==
Spoke to Curtis, he said to just add an exception similar to the existing
"projectgroups" one.

== Tests ==
bin/test -vvt pillar-views.txt

== Demo and Q/A ==
Nothing to show yet until my new page design lands. I am just breaking this
code out to a separate branch for ease of review.

= Launchpad lint =

Checking for conflicts. and issues in doctests and templates.
Running jslint, xmllint, pyflakes, and pylint.
Using normal rules.

Linting changed files:
  lib/lp/registry/browser/pillar.py
  lib/lp/registry/browser/tests/pillar-views.txt

Revision history for this message
Abel Deuring (adeuring) wrote :

Hi Julian,

a nice branch. As mentioned on IRC, I think you don't

> === modified file 'lib/lp/registry/browser/pillar.py'
> --- lib/lp/registry/browser/pillar.py 2009-08-18 14:36:16 +0000
> +++ lib/lp/registry/browser/pillar.py 2009-08-28 12:01:27 +0000
> @@ -20,6 +20,8 @@
> from canonical.launchpad.webapp.publisher import LaunchpadView, nearest
> from canonical.launchpad.webapp.tales import MenuAPI
>
> +from lp.registry.interfaces.distributionsourcepackage import (
> + IDistributionSourcePackage)
> from lp.registry.interfaces.pillar import IPillar
> from lp.registry.interfaces.project import IProject
>
> @@ -78,6 +80,10 @@
> self._set_official_launchpad(product)
> # Projectgroups do not support submit code.
> self.official_codehosting = False
> + elif IDistributionSourcePackage.providedBy(self.context):
> + # Distro source packages don't have blueprints.
> + self._set_official_launchpad(pillar)
> + self.official_blueprints = False

self.official_blueprints is already set to False a few lines above, in the "unconcitional part" of __init__()

Abel

> else:
> self._set_official_launchpad(pillar)
>

review: Approve
Revision history for this message
Julian Edwards (julian-edwards) wrote :

On Friday 28 August 2009 14:09:02 Abel Deuring wrote:
> >
> > @@ -78,6 +80,10 @@
> > self._set_official_launchpad(product)
> > # Projectgroups do not support submit code.
> > self.official_codehosting = False
> > + elif IDistributionSourcePackage.providedBy(self.context):
> > + # Distro source packages don't have blueprints.
> > + self._set_official_launchpad(pillar)
> > + self.official_blueprints = False
>
> self.official_blueprints is already set to False a few lines above, in the
> "unconcitional part" of __init__()
>
> Abel

Hi, as mentioned on IRC, it's overriding what
self._set_official_launchpad(pillar) sets it to (which is True, because the
pillar is the distro).

I'll make those comments clearer to explain that.

Thanks for the review.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'lib/lp/registry/browser/pillar.py'
--- lib/lp/registry/browser/pillar.py 2009-08-18 14:36:16 +0000
+++ lib/lp/registry/browser/pillar.py 2009-08-28 12:01:27 +0000
@@ -20,6 +20,8 @@
20from canonical.launchpad.webapp.publisher import LaunchpadView, nearest20from canonical.launchpad.webapp.publisher import LaunchpadView, nearest
21from canonical.launchpad.webapp.tales import MenuAPI21from canonical.launchpad.webapp.tales import MenuAPI
2222
23from lp.registry.interfaces.distributionsourcepackage import (
24 IDistributionSourcePackage)
23from lp.registry.interfaces.pillar import IPillar25from lp.registry.interfaces.pillar import IPillar
24from lp.registry.interfaces.project import IProject26from lp.registry.interfaces.project import IProject
2527
@@ -78,6 +80,10 @@
78 self._set_official_launchpad(product)80 self._set_official_launchpad(product)
79 # Projectgroups do not support submit code.81 # Projectgroups do not support submit code.
80 self.official_codehosting = False82 self.official_codehosting = False
83 elif IDistributionSourcePackage.providedBy(self.context):
84 # Distro source packages don't have blueprints.
85 self._set_official_launchpad(pillar)
86 self.official_blueprints = False
81 else:87 else:
82 self._set_official_launchpad(pillar)88 self._set_official_launchpad(pillar)
8389
8490
=== modified file 'lib/lp/registry/browser/tests/pillar-views.txt'
--- lib/lp/registry/browser/tests/pillar-views.txt 2009-08-15 04:31:42 +0000
+++ lib/lp/registry/browser/tests/pillar-views.txt 2009-08-28 12:01:43 +0000
@@ -109,8 +109,11 @@
109 submit_code register_blueprint109 submit_code register_blueprint
110110
111DistributionSourcePackages can use this view. The distribution is used to111DistributionSourcePackages can use this view. The distribution is used to
112set the links.112set the links. Despite the fact that the distribution uses blueprints,
113the blueprint link is not enabled for DistributionSourcePackages.
113114
115 >>> login_person(distribution.owner)
116 >>> distribution.official_blueprints = True
114 >>> package = factory.makeDistributionSourcePackage(117 >>> package = factory.makeDistributionSourcePackage(
115 ... distribution=distribution)118 ... distribution=distribution)
116 >>> view = create_view(package, '+get-involved')119 >>> view = create_view(package, '+get-involved')