Skip to content

Commit

Permalink
icbc plate jurisdiction fix (#256)
Browse files Browse the repository at this point in the history
  • Loading branch information
JustinMacaulay authored Dec 19, 2023
1 parent 9c64b33 commit 712c566
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions python/form_handler/actions.py
Original file line number Diff line number Diff line change
Expand Up @@ -361,8 +361,18 @@ def prep_icbc_payload(**args)->tuple:
birthdate= birthdate.strftime('%Y%m%d')
tmp_payload["birthdate"]=birthdate

if "vehicle_jurisdiction" in event_data :
tmp_payload["plateJurisdiction"]=event_data["vehicle_jurisdiction"]
if event_data["vehicle_jurisdiction"]:
tmp_jurisdictionvalue=event_data["vehicle_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["plateJurisdiction"]= ''
else:
tmp_payload["plateJurisdiction"]= juris_data[0].icbc_jurisdiction_code

if "vehicle_plate_no" in event_data:
tmp_plate_no=event_data["vehicle_plate_no"].upper()
Expand Down

0 comments on commit 712c566

Please sign in to comment.