Skip to content

Commit

Permalink
Fix habitat value in occurrence upload (#4224)
Browse files Browse the repository at this point in the history
  • Loading branch information
dimasciput authored Sep 5, 2024
1 parent 7da84bf commit bec6c5a
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions bims/scripts/occurrences_upload.py
Original file line number Diff line number Diff line change
Expand Up @@ -695,13 +695,16 @@ def process_data(self, row):
row, PRESENT))

# -- Optional data - Habitat
if HABITAT in row and DataCSVUpload.row_value(row, HABITAT):
habitat_value = DataCSVUpload.row_value(row, HABITAT)
if HABITAT in row and habitat_value:
habitat_choices = {
v: k for k, v in
BiologicalCollectionRecord.HABITAT_CHOICES
}
if habitat_value in habitat_choices:
habitat_value = habitat_choices[habitat_value]
optional_data['collection_habitat'] = (
habitat_choices[DataCSVUpload.row_value(row, HABITAT)]
habitat_value
)

# -- Optional data - Sampling method
Expand Down

0 comments on commit bec6c5a

Please sign in to comment.