fix: gstin validation should work when there is no state (#16378)

This commit is contained in:
Sagar Vora 2019-01-10 11:57:24 +05:30 committed by GitHub
parent 6b466fe230
commit f99e013ebc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -21,7 +21,9 @@ def validate_gstin_for_india(doc, method):
validate_gstin_check_digit(doc.gstin)
if not doc.gst_state and doc.state:
if not doc.gst_state:
if not doc.state:
return
state = doc.state.lower()
states_lowercase = {s.lower():s for s in states}
if state in states_lowercase: