Skip to content

Commit

Permalink
Missed ICBC province code (#255)
Browse files Browse the repository at this point in the history
  • Loading branch information
JustinMacaulay authored Dec 19, 2023
1 parent 7450e27 commit 9c64b33
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion python/form_handler/actions.py
Original file line number Diff line number Diff line change
Expand Up @@ -370,7 +370,18 @@ def prep_icbc_payload(**args)->tuple:
tmp_payload["plateNumber"]=tmp_plate_no

if event_data["nsc_prov_state"]:
tmp_payload["pujCode"]=event_data["nsc_prov_state"]
tmp_jurisdictionvalue=event_data["driver_jurisdiction"]
with application.app_context():
# get jurisdiction data
juris_data = db.session.query(JurisdictionCrossRef) \
.filter(JurisdictionCrossRef.jurisdiction_code == tmp_jurisdictionvalue) \
.all()
if len(juris_data) == 0:
logging.error("jurisdiction not found")
tmp_payload["pujCode"]= ''
else:
tmp_payload["pujCode"]= juris_data[0].icbc_jurisdiction_code

else:
tmp_payload["pujCode"]="BC"

Expand Down

0 comments on commit 9c64b33

Please sign in to comment.