Skip to content

Commit

Permalink
Fix taxa upload (#4166)
Browse files Browse the repository at this point in the history
  • Loading branch information
dimasciput authored Aug 19, 2024
1 parent a2aaab5 commit 47f8027
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions bims/scripts/taxa_upload.py
Original file line number Diff line number Diff line change
Expand Up @@ -189,14 +189,14 @@ def origin(self, row):
"""Processing origin"""
origin_value = DataCSVUpload.row_value(row, ORIGIN)
if not origin_value:
return ''
return '', None
if 'invasive' in origin_value.lower():
invasive, _ = Invasion.objects.get_or_create(
category=origin_value
)
return ORIGIN_CATEGORIES['non-native'], invasive
if origin_value.lower() not in ORIGIN_CATEGORIES:
return ''
return '', None
return ORIGIN_CATEGORIES[origin_value.lower()], None

def validate_parents(self, taxon, row):
Expand Down

0 comments on commit 47f8027

Please sign in to comment.