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

Commit

Permalink
fixes bug 888197 and followup for bug 891815 - trunacte buildid corre…
Browse files Browse the repository at this point in the history
…ctly, add new platform codes, filter out non-unique platform codes
  • Loading branch information
rhelmer committed Jul 16, 2013
1 parent 80cac41 commit 736e9b1
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 4 deletions.
8 changes: 8 additions & 0 deletions crashstats/crashstats/models.py
Expand Up @@ -474,6 +474,10 @@ def get(self):
'code': 'win',
'name': 'Windows'
},
{
'code': 'win32',
'name': 'Windows'
},
{
'code': 'win',
'name': 'Windows NT'
Expand All @@ -485,6 +489,10 @@ def get(self):
{
'code': 'lin',
'name': 'Linux'
},
{
'code': 'linux-i686',
'name': 'Linux'
}
]
return platforms
Expand Down
15 changes: 11 additions & 4 deletions crashstats/crashstats/views.py
Expand Up @@ -1082,12 +1082,19 @@ def report_list(request, default_context=None):
builds_api = models.DailyBuilds()
builds = builds_api.get(product=context['product'],
version=versions)
os_api = models.Platforms()
operating_systems = os_api.get()
for build in builds:
os_name = build['platform']
for os in operating_systems:
if build['platform'] == os['code']:
os_name = os['name']
if os_name is None:
continue

try:
build_date = datetime.datetime.strptime(str(build['buildid']),
'%Y%m%d%H%M%S')
buildid = build_date.strftime('%Y%m%d')
buildid = build_date.strftime('%Y%m%d%H')
except ValueError:
buildid = build['buildid']

Expand Down Expand Up @@ -1356,10 +1363,10 @@ def query(request, default_context=None):
if params['build_id']:
params['build_id'] = [unicode(x) for x in params['build_id']]

params['platforms_names'] = [
params['platforms_names'] = sorted(set([
p['name'] for p in platforms
if p['code'] in params['platforms']
]
]))

context['params'] = params
context['params_json'] = json.dumps({'versions': params['versions'],
Expand Down

0 comments on commit 736e9b1

Please sign in to comment.