Skip to content

fix: fall back to customer id when shopify name and email are missing#434

Open
SAY-5 wants to merge 3 commits into
frappe:developfrom
SAY-5:fix/shopify-customer-none-name
Open

fix: fall back to customer id when shopify name and email are missing#434
SAY-5 wants to merge 3 commits into
frappe:developfrom
SAY-5:fix/shopify-customer-none-name

Conversation

@SAY-5

@SAY-5 SAY-5 commented Jun 18, 2026

Copy link
Copy Markdown

Issue: customer sync crashes with AttributeError: 'NoneType' object has no attribute 'strip' when a Shopify customer has no first name, last name, or email. In that case customer_name ends up as None and ERPNext rejects it.

Fixes #432

Falls back to Customer {id} so a usable name is always passed through.

Signed-off-by: Sai Asish Y <say.apm35@gmail.com>
@SAY-5
SAY-5 requested a review from ankush as a code owner June 18, 2026 18:44
@greptile-apps

greptile-apps Bot commented Jul 18, 2026

Copy link
Copy Markdown

Confidence Score: 4/5

Safe to merge if the same fallback is applied to update_existing_addresses; otherwise nameless-customer address updates will persist a blank title.

update_existing_addresses builds customer_name the same way as the code being fixed but has no fallback, so it will still write a whitespace-only address_title for customers with no first/last name.

ecommerce_integrations/shopify/customer.py — update_existing_addresses needs the same fix applied to sync_customer.

Reviews (2): Last reviewed commit: "Merge branch 'develop' into fix/shopify-..." | Re-trigger Greptile

Comment on lines +27 to +28
if not customer_name:
customer_name = f"Customer {customer.get('id')}"

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 If customer.get('id') is also None the fallback becomes "Customer None". Using or 'Unknown' keeps it explicit, though this edge case is practically impossible with Shopify.

Suggested change
if not customer_name:
customer_name = f"Customer {customer.get('id')}"
if not customer_name:
customer_name = f"Customer {customer.get('id') or 'Unknown'}"

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

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.

AttributeError: 'NoneType' object has no attribute 'strip'

1 participant