Skip to content

Commit

Permalink
Fix Public/Clinical Health Project Import Error
Browse files Browse the repository at this point in the history
- Add custom transalter for New Health Sectors/Tags
  • Loading branch information
thenav56 committed Apr 28, 2020
1 parent d8dbcc4 commit fae7ee6
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions deployments/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit fae7ee6

Please sign in to comment.