Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: handle missing 'number_plate' key in check_bills_all_vehicles function #328

Merged
merged 1 commit into from
Jun 19, 2024

Conversation

nelsonmpanju
Copy link

…e' key

Copy link
Owner

@aakvatech aakvatech left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Log error should have title and message parameter names

@nelsonmpanju nelsonmpanju changed the title fix: KeyError in check_bills_all_vehicles due to missing 'number_plat… fix: handle missing 'number_plate' key in check_bills_all_vehicles function Jun 19, 2024
except Exception as e:
frappe.log_error(frappe.get_traceback(), str(e))
number_plate = vehicle.get("number_plate") or vehicle.get("license_plate")
vehicle_name = vehicle.get("name")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You don't need a get for "name". It will ALWAYS be there

def get_bills(number_plate):
headers = {
'x-transfer-key': 'e9f3e572-db87-4eff-9ed6-66922f1f7f24',
}

url = (
"https://termis.tarura.go.tz:6003/termis-parking-service/api/v1/parkingDetails/debts/plateNumber/"
"http://termis.tarura.go.tz:6003/termis-parking-service/api/v1/parkingDetails/debts/plateNumber/"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

They removed SSL???

@aakvatech aakvatech merged commit a573449 into aakvatech:version-14 Jun 19, 2024
1 of 2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants