Closed moshthepitt closed 5 years ago
Currently the mspray.apps.main.views.performance module does, among other things, calculations such that look like:
mspray.apps.main.views.performance
"not_sprayed_total": sum( [i["not_sprayed_total"] for i in serializer.data] )
See https://github.com/onaio/mspray/blob/master/mspray/apps/main/views/performance.py#L118 for an example.
We can make this a little better by using generator expressions instead of list comprehensions in order to get the sum(s).
Additionally, once this is done we should add tests for those parts of the code that we change.
Fixed by #488
Currently the
mspray.apps.main.views.performance
module does, among other things, calculations such that look like:See https://github.com/onaio/mspray/blob/master/mspray/apps/main/views/performance.py#L118 for an example.
We can make this a little better by using generator expressions instead of list comprehensions in order to get the sum(s).
Additionally, once this is done we should add tests for those parts of the code that we change.