Merge lp:~wgrant/launchpad/bug-592914-recipe-distroseries-order into lp:launchpad
Proposed by
William Grant
Status: | Merged | ||||
---|---|---|---|---|---|
Approved by: | Māris Fogels | ||||
Approved revision: | no longer in the source branch. | ||||
Merged at revision: | 11016 | ||||
Proposed branch: | lp:~wgrant/launchpad/bug-592914-recipe-distroseries-order | ||||
Merge into: | lp:launchpad | ||||
Diff against target: |
50 lines (+9/-5) 2 files modified
lib/lp/code/browser/sourcepackagerecipe.py (+7/-3) lib/lp/code/browser/tests/test_sourcepackagerecipe.py (+2/-2) |
||||
To merge this branch: | bzr merge lp:~wgrant/launchpad/bug-592914-recipe-distroseries-order | ||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Māris Fogels (community) | Approve | ||
Review via email: mp+27415@code.launchpad.net |
Commit message
Sort by version the distroseries list when creating recipes and builds.
Description of the change
This branch fixes bug #592914 by sorting the distroseries vocabulary used when creating recipes and requesting builds. It's just reverse sorting by DistroSeries.
I've updated the broken test, and there is no lint.
To post a comment you must log in.
Hi William,
The fix looks good, but I had two concerns:
* Would it be better to use attrgetter instead of the lambda?: sorted(.., key=attrgetter( 'value. version' ))
* Just a comment, but the call to term.value.version breaks the Law of Demeter (http:// en.wikipedia. org/wiki/ Law_of_ Demeter). That often indicates an object design problem, but since we are working with data objects, I think it can pass here.
Looks good! r=mars
Maris