Merge lp://staging/~rharding/launchpad/bp_default_1062207 into lp://staging/launchpad

Proposed by Richard Harding
Status: Merged
Approved by: Aaron Bentley
Approved revision: no longer in the source branch.
Merged at revision: 16131
Proposed branch: lp://staging/~rharding/launchpad/bp_default_1062207
Merge into: lp://staging/launchpad
Diff against target: 70 lines (+22/-2)
3 files modified
lib/lp/blueprints/browser/specification.py (+5/-2)
lib/lp/blueprints/browser/tests/test_specification.py (+16/-0)
lib/lp/registry/browser/product.py (+1/-0)
To merge this branch: bzr merge lp://staging/~rharding/launchpad/bp_default_1062207
Reviewer Review Type Date Requested Status
Aaron Bentley (community) Approve
Review via email: mp+129001@code.staging.launchpad.net

Commit message

Add initial value date for the information_type and default to PUBLIC vs None

Description of the change

= Summary =

The information type input widget was not getting a default value so when you
submitted the form you had an error that the field was not set.

This branch forces a default initial value.

== Implementation Notes ==

If there was no initial value from the context, the code set information type
to None. This caused the input to not have a set value on render. This changes
that None value to PUBLIC since it's the usual default.

It adds a test for all of the test cases extending the base that checks this
default value is set. It also overrides for the one test case where PUBLIC is
not a valid information type.

There's a drive by lint and setting of this default on the product
registration as well.

Note: I've filed bug #1065161 about the issue that the UX issues presented by
the choice edit widget that complicated this issue.

== Q/A ==

Per the bug, going to the +addspec page and submitting a new spec should work
without changing the information type field at all. It should get a default
value of PUBLIC.

== Tests ==

browser/tests/test_specification.py

To post a comment you must log in.
Revision history for this message
Richard Harding (rharding) wrote :

Per chat with Aaron in irc. We should be using the getDefaultSpecificationInformationType of the various pillars vs hard coding the default to being InformationType.PUBLIC.

Revision history for this message
Aaron Bentley (abentley) wrote :

At first, I thought that this would always set the value to PUBLIC, but it only does so if the context is not a Product, or the Product's default is PUBLIC. So this is a good change.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
The diff is not available at this time. You can reload the page or download it.