File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -125,7 +125,9 @@ def email_validator_function(email_str):
125125
126126def flexible_lexicon_validator (enum_cls ):
127127 def validator (v ):
128- if v is None or v == "" :
128+ if v is None :
129+ return None
130+ if isinstance (v , str ) and v .strip () == "" :
129131 return None
130132 if isinstance (v , enum_cls ):
131133 return v
Original file line number Diff line number Diff line change @@ -1258,6 +1258,14 @@ def test_blank_well_status_is_treated_as_none(self):
12581258
12591259 assert model .well_status is None
12601260
1261+ def test_whitespace_only_well_status_is_treated_as_none (self ):
1262+ row = _minimal_valid_well_inventory_row ()
1263+ row ["well_hole_status" ] = " "
1264+
1265+ model = WellInventoryRow (** row )
1266+
1267+ assert model .well_status is None
1268+
12611269 def test_canonical_name_wins_when_alias_and_canonical_present (self ):
12621270 row = _minimal_valid_well_inventory_row ()
12631271 row ["well_status" ] = "Abandoned"
You can’t perform that action at this time.
0 commit comments