Merge lp:~jcsackett/launchpad/broken-links-person-translations into lp:launchpad
Status: | Merged | ||||
---|---|---|---|---|---|
Approved by: | Curtis Hovey | ||||
Approved revision: | no longer in the source branch. | ||||
Merged at revision: | 16217 | ||||
Proposed branch: | lp:~jcsackett/launchpad/broken-links-person-translations | ||||
Merge into: | lp:launchpad | ||||
Diff against target: |
63 lines (+15/-2) 3 files modified
lib/lp/translations/browser/person.py (+6/-1) lib/lp/translations/browser/tests/test_persontranslationview.py (+7/-0) lib/lp/translations/model/translationsperson.py (+2/-1) |
||||
To merge this branch: | bzr merge lp:~jcsackett/launchpad/broken-links-person-translations | ||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Curtis Hovey (community) | code | Approve | |
Review via email: mp+131199@code.launchpad.net |
Commit message
Filters products not using translations out of the recent history in Person:
Description of the change
Summary
=======
Products which have translations but are no longer setup to use translations
create 404 links in Person+translations in the recent activity display.
The initial assumption was that the translation_history query on
TranslationPerson was bad, and should do the filtering. However, this query is
used in places where the absolute history is necessary (e.g. showing if a
person has *ever* done a translation) and the number of joins necessary to
filter at the level poses a performance risk with large histories.
The view for Person+translations has a method, `recent_history` which already
filters the translation_history to weed out inactive projects. This method
should also filter out projects no longer using translations.
Preimp
======
Spoke with Curtis Hovey.
Implementation
==============
`recent_activity`'s filtering method, `is_active`, now checks for
`product.
`product.active`.
The test for recent_activity now includes a pofile, which should be excluded,
that is linked to a product where translations_usage is
ServiceUsage.
Tests
=====
bin/test -vvct test_recent_
QA
==
Ensure that the page linked in the bug no longer has 404ing links.
LoC
===
I have ~400 LoC in credit.
Lint
====
Checking for conflicts and issues in changed files.
Linting changed files:
lib/lp/
lib/lp/
lib/lp/
Thank you.