Merge ~cjwatson/launchpad:refactor-searchPPAs into launchpad:master
Status: | Merged |
---|---|
Approved by: | Colin Watson |
Approved revision: | cb167cf493fc9be53375cc7efa52e4a84dfe3ffe |
Merge reported by: | Otto Co-Pilot |
Merged at revision: | not available |
Proposed branch: | ~cjwatson/launchpad:refactor-searchPPAs |
Merge into: | launchpad:master |
Diff against target: |
188 lines (+91/-36) 2 files modified
lib/lp/registry/model/distribution.py (+21/-36) lib/lp/registry/tests/test_distribution.py (+70/-0) |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Ines Almeida | Approve | ||
Review via email: mp+450704@code.launchpad.net |
Commit message
Refactor Distribution.
Description of the change
This doesn't behave quite identically to the previous code, but I think the changes are slight improvements: search results for commercial admins include private archives to reflect their view privileges, and search results for ordinary users include archives where they have upload permissions even if they don't own them.
Those are niche changes, though, and this is mainly just intended as a refactoring. My motivations here are to get rid of some more SQLObject-flavoured code, and that it's easier to understand code when it uses well-established helper functions for moderately complex tasks rather than having open-coded near-equivalents for them.
The changes make sense to me, and look good code wise.
The only thing I see "missing" is test changes, which suggests that maybe we don't really have a lot of coverage on the `searchPPAs` function specifically. I think it would benefit from some edge cases tests that reflects these changes.