From: Tom Rees Date: Tue, 02 Apr 2013 16:25:45 +0000 Subject: [403] Fix rickshaw choking if there is an empty 'Others' series. X-Git-Url: http://maxious.lambdacomplex.org/git/?p=ckanext-ga-report.git&a=commitdiff&h=712b17e95c6b16fa6a688d274665b2d1701515ba --- [403] Fix rickshaw choking if there is an empty 'Others' series. --- --- a/ckanext/ga_report/controller.py +++ b/ckanext/ga_report/controller.py @@ -450,10 +450,11 @@ data.append(series) # Overwrite data with a set of interesting series others = [ x for x in raw_data if not (x in data) ] - data.append({ - 'name':'Other', - 'data': [ {'x':x,'y':y} for x,y in get_totals(others).items() ] - }) + if len(others): + data.append({ + 'name':'Other', + 'data': [ {'x':x,'y':y} for x,y in get_totals(others).items() ] + }) # Turn each point into a percentage for series in data: for point in series['data']: