From fae7ee6611be44a9b7f3f519b8737978b71fef78 Mon Sep 17 00:00:00 2001 From: thenav56 Date: Tue, 28 Apr 2020 09:12:28 +0545 Subject: [PATCH] Fix Public/Clinical Health Project Import Error - Add custom transalter for New Health Sectors/Tags --- deployments/forms.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/deployments/forms.py b/deployments/forms.py index 569f71fb3..3c4753960 100644 --- a/deployments/forms.py +++ b/deployments/forms.py @@ -67,6 +67,19 @@ def parse_integer(integer): sector_tags = {label.lower(): value for value, label in SectorTags.choices()} statuses = {label.lower(): value for value, label in Statuses.choices()} + # Handle Custom Sectors/Tags for Health (Keys all lower) + sectors.update({ + 'health': Sectors.HEALTH_PUBLIC, + 'health (public)': Sectors.HEALTH_PUBLIC, + 'health (clinical)': Sectors.HEALTH_CLINICAL, + }) + sector_tags.update({ + 'health': SectorTags.HEALTH_PUBLIC, + 'health (public)': SectorTags.HEALTH_PUBLIC, + 'health (clinical)': SectorTags.HEALTH_CLINICAL, + }) + + # Extract from import csv file for row in reader: # TODO: Try to do this in a single query district_name = row['Region'].strip()