Skip to content

Commit 8567db7

Browse files
committed
fix: allow phone number to be optional in well inventory import
handle none values when validating the optional phone number field in the well inventory import. This allows for blank or missing phone numbers without causing validation errors.
1 parent d9b2bd8 commit 8567db7

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

schemas/well_inventory.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,10 @@ def state_validator(v):
9292

9393

9494
def phone_validator(phone_number_str):
95+
# Allow optional phone fields: treat None or blank as no value.
96+
if phone_number_str is None:
97+
return None
98+
9599
phone_number_str = phone_number_str.strip()
96100
if phone_number_str:
97101
parsed_number = phonenumbers.parse(phone_number_str, "US")

0 commit comments

Comments
 (0)