Skip to content

Commit

Permalink
Merge pull request #118 from tarunbhardwaj/part_name_fix
Browse files Browse the repository at this point in the history
Handle case when customer's firstname and lastname is None
  • Loading branch information
prakashpp committed Jun 5, 2015
2 parents f7cb070 + 71d28d3 commit c4a20a7
Show file tree
Hide file tree
Showing 3 changed files with 217 additions and 76 deletions.
12 changes: 10 additions & 2 deletions sale.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,9 +119,17 @@ def get_sale_using_magento_data(cls, order_data):
order_data['customer_id']
)
else:
firstname = order_data['customer_firstname'] or (
order_data['billing_address'] and
order_data['billing_address']['firstname']
)
lastname = order_data['customer_lastname'] or (
order_data['billing_address'] and
order_data['billing_address']['lastname']
)
party = Party.create_using_magento_data({
'firstname': order_data['customer_firstname'],
'lastname': order_data['customer_lastname'],
'firstname': firstname,
'lastname': lastname,
'email': order_data['customer_email'],
'customer_id': 0
})
Expand Down

0 comments on commit c4a20a7

Please sign in to comment.