fix: fall back to customer id when shopify name and email are missing#434
fix: fall back to customer id when shopify name and email are missing#434SAY-5 wants to merge 3 commits into
Conversation
Signed-off-by: Sai Asish Y <say.apm35@gmail.com>
Confidence Score: 4/5Safe to merge if the same fallback is applied to
ecommerce_integrations/shopify/customer.py — Reviews (2): Last reviewed commit: "Merge branch 'develop' into fix/shopify-..." | Re-trigger Greptile |
| if not customer_name: | ||
| customer_name = f"Customer {customer.get('id')}" |
There was a problem hiding this comment.
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.
| 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!
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 casecustomer_nameends up asNoneand ERPNext rejects it.Fixes #432
Falls back to
Customer {id}so a usable name is always passed through.