From 3b11debcd284d598762dc031399a1b289434db3d Mon Sep 17 00:00:00 2001 From: Charles-Henri Decultot Date: Tue, 2 Oct 2018 09:16:15 +0200 Subject: [PATCH] Gocardless correction (#15554) --- erpnext/templates/pages/integrations/gocardless_checkout.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/erpnext/templates/pages/integrations/gocardless_checkout.py b/erpnext/templates/pages/integrations/gocardless_checkout.py index 2ba7001a61..8d77245ce5 100644 --- a/erpnext/templates/pages/integrations/gocardless_checkout.py +++ b/erpnext/templates/pages/integrations/gocardless_checkout.py @@ -46,8 +46,10 @@ def check_mandate(data, reference_doctype, reference_docname): prefilled_customer = { "company_name": payer.name, "given_name": primary_contact.first_name, - "family_name": primary_contact.last_name, } + if primary_contact.last_name is not None: + prefilled_customer.update({"family_name": primary_contact.last_name}) + if primary_contact.email_id is not None: prefilled_customer.update({"email": primary_contact.email_id}) else: