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: On woocommerce test ping issued during a webhook creation, retur… #36705

Merged
merged 1 commit into from
Aug 26, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,10 @@
if frappe.flags.woocomm_test_order_data:
order = frappe.flags.woocomm_test_order_data
event = "created"

# Ignore the test ping issued during WooCommerce webhook configuration
# Ref: https://github.com/woocommerce/woocommerce/issues/15642
if frappe.request.data.decode('utf-8').startswith('webhook_id='):
return "success"

Check warning on line 47 in erpnext/erpnext_integrations/connectors/woocommerce_connection.py

View check run for this annotation

Codecov / codecov/patch

erpnext/erpnext_integrations/connectors/woocommerce_connection.py#L46-L47

Added lines #L46 - L47 were not covered by tests
elif frappe.request and frappe.request.data:
verify_request()
try:
Expand Down Expand Up @@ -81,7 +84,9 @@
customer.save()

if customer_exists:
frappe.rename_doc("Customer", old_name, customer_name)
# Fixes https://github.com/frappe/erpnext/issues/33708
if old_name != customer_name:
frappe.rename_doc("Customer", old_name, customer_name)

Check warning on line 89 in erpnext/erpnext_integrations/connectors/woocommerce_connection.py

View check run for this annotation

Codecov / codecov/patch

erpnext/erpnext_integrations/connectors/woocommerce_connection.py#L88-L89

Added lines #L88 - L89 were not covered by tests
for address_type in (
"Billing",
"Shipping",
Expand Down
Loading