Clean up IHasTranslationTemplates
Bug #605924 reported by
Jeroen T. Vermeulen
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Launchpad itself |
Fix Released
|
Low
|
Henning Eggers |
Bug Description
The IHasTranslation
A few things in particular that we should clean up follow.
Return values: some methods return lists, others result sets. A bit of consistency would be nice.
Obsolete templates: the pre-existing behaviour is to consider all templates obsolete if their containing product or distribution has translations disabled. It should be up to the browser code to show templates only to authorized visitors if translations are disabled; only POTemplate.
Related branches
lp:~henninge/launchpad/devel-605924-hastranslationtemplates
- Данило Шеган (community): Approve
-
Diff: 1172 lines (+387/-420)19 files modifiedlib/lp/registry/interfaces/productseries.py (+1/-1)
lib/lp/registry/model/distribution.py (+5/-8)
lib/lp/registry/model/distroseries.py (+1/-12)
lib/lp/registry/model/product.py (+7/-2)
lib/lp/registry/model/productseries.py (+1/-12)
lib/lp/soyuz/model/sourcepackagerelease.py (+6/-3)
lib/lp/soyuz/tests/test_sourcepackagerelease.py (+7/-3)
lib/lp/translations/browser/pofile.py (+2/-13)
lib/lp/translations/browser/potemplate.py (+2/-13)
lib/lp/translations/browser/productseries.py (+1/-2)
lib/lp/translations/browser/sourcepackage.py (+2/-4)
lib/lp/translations/doc/distroseries-language.txt (+5/-7)
lib/lp/translations/interfaces/hastranslationtemplates.py (+7/-8)
lib/lp/translations/model/hastranslationtemplates.py (+12/-19)
lib/lp/translations/model/potemplate.py (+3/-29)
lib/lp/translations/templates/distroseries-translations.pt (+121/-121)
lib/lp/translations/templates/productseries-translations.pt (+149/-148)
lib/lp/translations/tests/test_hastranslationtemplates.py (+54/-13)
lib/lp/translations/utilities/translation_import.py (+1/-2)
tags: | added: tech-debt |
Changed in rosetta: | |
status: | New → Triaged |
importance: | Undecided → Low |
Changed in launchpad: | |
status: | Triaged → In Progress |
assignee: | nobody → Henning Eggers (henninge) |
tags: |
added: qa-untestable removed: qa-needstesting |
Changed in launchpad: | |
status: | Fix Committed → Fix Released |
To post a comment you must log in.
My plan for fixing this: emplateFormats and getObsoleteTran slationTemplate s where each one only has one call site. These could easily be listified there but getObsoleteTran slationTemplate s is only used to check its length for >0 ... So I will convert that to has_obsolete_ translation_ templates.
Return values: Return templates as result sets. This only affects getTranslationT
Obsolete templates: My plan now is to remove that and see which tests fail. The solution is pretty clear, finding all the right places is the work here.