Skip to content

Commit

Permalink
Merge pull request #5223 from lwyszomi/global-stats-again
Browse files Browse the repository at this point in the history
ILSGateway, EWSGhana: fixed bug
  • Loading branch information
czue committed Jan 7, 2015
2 parents d7408a8 + 86f4494 commit d8f726f
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions custom/ilsgateway/views.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import json
from django.core.urlresolvers import reverse
from django.http.response import HttpResponseRedirect
import itertools
from corehq.apps.commtrack.models import CommtrackConfig, StockState
from corehq.apps.products.models import SQLProduct
from corehq.apps.domain.views import BaseDomainView
Expand Down Expand Up @@ -77,11 +76,13 @@ def main_context(self):
}

if self.show_supply_point_types:
supply_point_types = ['clinic', 'chps facility', 'district hospital', 'health centre', 'hospital',
'psychiatric hospital', 'regional medical store', 'regional hospital', 'polyclinic',
'teaching hospital', 'central medical store', '']
supply_point_types = [
'clinic', 'chps facility', 'district hospital', 'health centre', 'hospital',
'psychiatric hospital', 'regional medical store', 'regional hospital', 'polyclinic',
'teaching hospital', 'central medical store', ''
]
supply_point_types_map = {supply_point_type: 0 for supply_point_type in supply_point_types}
facility_ids = [location.location_id for location in SQLLocation.objects.all()]
facility_ids = [location.location_id for location in SQLLocation.objects.filter(domain=self.domain)]
for facility in iter_docs(Location.get_db(), facility_ids):
supply_point_type = facility.get('metadata', {}).get('supply_point_type', "").lower()
supply_point_types_map[supply_point_type] += 1
Expand Down

0 comments on commit d8f726f

Please sign in to comment.