Merge lp://staging/~edwin-grubbs/launchpad/bug-553384-deactivated-project-oops into lp://staging/launchpad
Status: | Merged |
---|---|
Approved by: | Gavin Panella |
Approved revision: | no longer in the source branch. |
Merged at revision: | not available |
Proposed branch: | lp://staging/~edwin-grubbs/launchpad/bug-553384-deactivated-project-oops |
Merge into: | lp://staging/launchpad |
Diff against target: |
654 lines (+190/-101) 20 files modified
lib/lp/answers/doc/person.txt (+4/-0) lib/lp/blueprints/doc/specification.txt (+12/-8) lib/lp/blueprints/doc/sprint.txt (+12/-8) lib/lp/bugs/browser/bugalsoaffects.py (+0/-20) lib/lp/bugs/browser/tests/bugtask-adding-views.txt (+0/-36) lib/lp/registry/browser/product.py (+18/-4) lib/lp/registry/browser/tests/product-views.txt (+23/-5) lib/lp/registry/doc/milestone.txt (+4/-0) lib/lp/registry/doc/person.txt (+4/-0) lib/lp/registry/doc/pillar.txt (+3/-0) lib/lp/registry/doc/product.txt (+9/-3) lib/lp/registry/doc/project.txt (+9/-1) lib/lp/registry/model/product.py (+12/-1) lib/lp/registry/stories/pillar/xx-pillar-deactivation.txt (+15/-8) lib/lp/registry/stories/product/xx-product-edit.txt (+7/-7) lib/lp/registry/stories/project/xx-project-index.txt (+6/-0) lib/lp/registry/tests/test_product.py (+28/-0) lib/lp/testing/__init__.py (+14/-0) lib/lp/translations/doc/translationimportqueue.txt (+3/-0) lib/lp/translations/stories/translationgroups/30-show-group-translation-targets.txt (+7/-0) |
To merge this branch: | bzr merge lp://staging/~edwin-grubbs/launchpad/bug-553384-deactivated-project-oops |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Gavin Panella (community) | Approve | ||
Brad Crittenden (community) | code | Approve | |
Review via email: mp+23794@code.staging.launchpad.net |
Commit message
Don't let a project linked to source packages be deactivated, since it will cause an oops on the $sourcepackage/
Description of the change
Summary
-------
Fixed bug 553384 and bug 140526.
The $sourcepackage/
inactive project. To prevent this, it should not be possible to deactivate
a project until all its links to source packages have been removed.
Implementation details
-------
Don't allow deactivation of products linked to source packages in the
model or in the views.
lib/
lib/
lib/
lib/
Removed workaround for bug 140526:
lib/
lib/
Fixed tests:
lib/
lib/
lib/
lib/
lib/
lib/
lib/
lib/
lib/
lib/
lib/
lib/
lib/
lib/
Tests
-----
./bin/test -vv -t 'test_product|
Demo and Q/A
------------
* Open http://
* Uncheck the "active" input.
* Click "Change"
* The "active" field should have the error message:
"This project cannot be deactivated since it is still linked to
source packages."
* Open http://
* Uncheck the "active" input.
* Click "Change"
* The "active" field should have the error message:
"This project cannot be deactivated since it is still linked to
source packages."
Hi Edwin,
This is nice, and it's good to see some XXXs go in the process. The
view code with the Storm validator as a backstop is elegant.
I've got a few questions and comments, so Needs Information for now.
Cheers, Gavin.
> === modified file 'lib/lp/ answers/ doc/person. txt' answers/ doc/person. txt 2010-02-05 21:25:23 +0000 answers/ doc/person. txt 2010-04-21 11:03:32 +0000 source_ packages source_ packages( firefox) getDirectAnswer QuestionTargets ()) blueprints/ doc/specificati on.txt' blueprints/ doc/specificati on.txt 2009-08-13 19:03:36 +0000 blueprints/ doc/specificati on.txt 2010-04-21 11:03:32 +0000 database. sqlbase import flush_database_ updates firefox. active = False updates( ) specifications( filter= ['install' ]): installation kubuntu -check ubuntu database. sqlbase import flush_database_ updates source_ packages source_ packages( upstream_ firefox) firefox. active = False updates( ) specifications( filter= ['install' ]): installation kubuntu -check ubuntu blueprints/ doc/sprint. txt' blueprints/ doc/sprint. txt 2010-02-17 11:13:06 +0000 blueprints/ doc/sprint. txt 2010-04-21 11:03:32 +0000 launchpad. interfaces import IProductSet launchpad. ftests import login IProductSet) .getByName( 'firefox' ) updates( ) ons().count( ) launchpad. interfaces import IProductSet launchpad. ftests import login IProductSet) .getByName( 'firefox' ) source_ packages source_ packages( firefox) updates( ) ons().count( )
> --- lib/lp/
> +++ lib/lp/
> @@ -351,6 +351,10 @@
> supported projects.
>
> >>> login('<email address hidden>')
> +
> + # A product cannot be deactivated if it is linked to source packages.
> + >>> from lp.testing import unlink_
> + >>> unlink_
> >>> firefox.active = False
> >>> sorted(target.name
> ... for target in no_priv.
>
> === modified file 'lib/lp/
> --- lib/lp/
> +++ lib/lp/
> @@ -205,14 +205,18 @@
>
> Specs from inactive products are filtered out.
>
> - >>> from canonical.
> - >>> login('<email address hidden>')
> - >>> upstream_
> - >>> flush_database_
> - >>> for spec in specset.
> - ... print spec.name, spec.target.name
> - cluster-
> - media-integrity
> + >>> from canonical.
> + >>> login('<email address hidden>')
> +
> + # A product cannot be deactivated if it is linked to source packages.
> + >>> from lp.testing import unlink_
> + >>> unlink_
> + >>> upstream_
> + >>> flush_database_
> + >>> for spec in specset.
> + ... print spec.name, spec.target.name
> + cluster-
> + media-integrity
>
>
> Reset firefox so we don't mess up later tests.
>
> === modified file 'lib/lp/
> --- lib/lp/
> +++ lib/lp/
> @@ -151,14 +151,18 @@
>
> Inactive products are excluded from the listings.
>
> - >>> from canonical.
> - >>> from canonical.
> - >>> firefox = getUtility(
> - >>> login("<email address hidden>")
> - >>> firefox.active = False
> - >>> flush_database_
> - >>> ubz.specificati
> - 0
> + >>> from canonical.
> + >>> from canonical.
> + >>> firefox = getUtility(
> + >>> login("<email address hidden>")
> +
> + # A product cannot be deactivated if it is linked to source packages.
> + >>> from lp.testing import unlink_
> + >>> unlink_
> + >>> firefox.active = False
> + >>> flush_database_
> + >>> ubz.specificati
> + 0
>
> ...