launchpad-reviewers team mailing list archive
-
launchpad-reviewers team
-
Mailing list archive
-
Message #28041
[Merge] ~cjwatson/launchpad:simplify-most-translated-pillars-query into launchpad:master
Colin Watson has proposed merging ~cjwatson/launchpad:simplify-most-translated-pillars-query into launchpad:master.
Commit message:
Remove unnecessary clause from getMostTranslatedPillars
Requested reviews:
Launchpad code reviewers (launchpad-reviewers)
For more details, see:
https://code.launchpad.net/~cjwatson/launchpad/+git/launchpad/+merge/414957
`Product.information_type` has had a `NOT NULL` constraint for years.
--
Your team Launchpad code reviewers is requested to review the proposed merge of ~cjwatson/launchpad:simplify-most-translated-pillars-query into launchpad:master.
diff --git a/lib/lp/translations/model/translationsoverview.py b/lib/lp/translations/model/translationsoverview.py
index 8f21622..1ee8c97 100644
--- a/lib/lp/translations/model/translationsoverview.py
+++ b/lib/lp/translations/model/translationsoverview.py
@@ -52,10 +52,6 @@ class TranslationsOverview:
def getMostTranslatedPillars(self, limit=50):
"""See `ITranslationsOverview`."""
- # XXX Abel Deuring 2012-10-26 bug=1071751
- # The expression product.information_type IS NULL can be
- # removed once we have the DB constraint
- # "Product.information_type IS NULL".
query = """
SELECT LOWER(COALESCE(product_name, distro_name)) AS name,
product_id,
@@ -76,8 +72,7 @@ class TranslationsOverview:
WHERE category=3 AND
(product IS NOT NULL OR distribution IS NOT NULL) AND
(product.translations_usage = %s AND
- (product.information_type = %s OR
- product.information_type IS NULL) OR
+ product.information_type = %s OR
distribution.translations_usage = %s)
GROUP BY product.displayname, product.id,
distribution.displayname, distribution.id