Skip to content

Commit

Permalink
Merge pull request #857 from AdrianGaudebert/794164-products-order
Browse files Browse the repository at this point in the history
Fixes bug 794164 - Sorted the products list returned from the middleware.
  • Loading branch information
adngdb committed Oct 5, 2012
2 parents 50df35a + 3e5ab8a commit c37d98a
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 10 deletions.
7 changes: 6 additions & 1 deletion socorro/external/postgresql/products.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,12 @@ def _get_versions(self, params):
def _get_products(self):
""" Return a list of product names """

sql_query = "SELECT * FROM products"
sql_query = """
/* socorro.external.postgresql.products.Products._get_products */
SELECT *
FROM products
ORDER BY sort
"""

json_result = {
"total": 0,
Expand Down
18 changes: 9 additions & 9 deletions socorro/unittest/external/postgresql/test_products.py
Original file line number Diff line number Diff line change
Expand Up @@ -209,21 +209,21 @@ def test_get(self):
"sort": 1,
"default_version": "8.0",
"rapid_release_version": "8.0"
},
{
"product_name": "Fennec",
"release_name": "mobile",
"sort": 3,
"default_version": "11.0.1",
"rapid_release_version": "11.0"
},
},
{
"product_name": "Thunderbird",
"release_name": "thunderbird",
"sort": 2,
"default_version": "10.0.2b",
"rapid_release_version": "10.0"
}
},
{
"product_name": "Fennec",
"release_name": "mobile",
"sort": 3,
"default_version": "11.0.1",
"rapid_release_version": "11.0"
}
],
"total": 3
}
Expand Down

0 comments on commit c37d98a

Please sign in to comment.