Skip to content
This repository has been archived by the owner on Feb 1, 2018. It is now read-only.

Commit

Permalink
Merge pull request #324 from AdrianGaudebert/850988-products-order
Browse files Browse the repository at this point in the history
Fixes bug 850988 - Corrected the order of products in dropdowns.
  • Loading branch information
brandonsavage committed Apr 19, 2013
2 parents b71a70e + fdc1c54 commit 2b17e50
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
5 changes: 3 additions & 2 deletions crashstats/crashstats/models.py
Expand Up @@ -270,11 +270,12 @@ def clean(string):
class CurrentVersions(SocorroMiddleware):

def get(self):
products = CurrentProducts().get()['hits']
products = CurrentProducts().get()['products']
releases = CurrentProducts().get()['hits']
currentversions = []

for product_name in products:
for release in products[product_name]:
for release in releases[product_name]:
currentversions.append(release)

return currentversions
Expand Down
9 changes: 6 additions & 3 deletions crashstats/crashstats/tests/test_models.py
Expand Up @@ -106,7 +106,8 @@ def mocked_get(**options):
"version": "2.1.3pre",
"release": "Beta",
"id": 922}]
}
},
"products": ["Camino"]
}
""")

Expand Down Expand Up @@ -134,7 +135,8 @@ def mocked_get(**options):
"version": "2.1.3pre",
"release": "Beta",
"id": 922}]
}
},
"products": ["WaterWolf"]
}
""")

Expand Down Expand Up @@ -884,7 +886,8 @@ def mocked_get(**options):
"version": "2.1.3pre",
"release": "Beta",
"id": 922}]
}
},
"products": ["Camino"]
}
""")
rget.side_effect = mocked_get
Expand Down

0 comments on commit 2b17e50

Please sign in to comment.