Merge pull request #16820 from rohitwaghchaure/state_code_blank_if_not_matched_with_state_codes

fix: on save of the address, state code field become blank
This commit is contained in:
rohitwaghchaure 2019-03-04 16:59:45 +05:30 committed by GitHub
commit 55c382a780
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -343,4 +343,7 @@ def set_state_code(doc, method):
return
state_codes_lower = {key.lower():value for key,value in state_codes.items()}
doc.state_code = state_codes_lower.get(doc.get('state','').lower())
state = doc.get('state','').lower()
if state_codes_lower.get(state):
doc.state_code = state_codes_lower.get(state)