From f31838dbe5189c434e7c35e831185b044ccc7eee Mon Sep 17 00:00:00 2001 From: PCoder Date: Mon, 25 Dec 2023 12:22:34 +0530 Subject: [PATCH] Separate fields --- hosting/management/commands/change_ch_vatrate_2023.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/hosting/management/commands/change_ch_vatrate_2023.py b/hosting/management/commands/change_ch_vatrate_2023.py index cbf77060..45ec70d9 100644 --- a/hosting/management/commands/change_ch_vatrate_2023.py +++ b/hosting/management/commands/change_ch_vatrate_2023.py @@ -88,7 +88,8 @@ class Command(BaseCommand): vat_rate = subscription.get("tax_percent", "") c_user = CustomUser.objects.get( id=StripeCustomer.objects.filter(stripe_id=stripe_customer_id)[0].id) - customer_name = "%s - %s - %s" % (c_user.name, c_user.email, stripe_customer_id) + customer_name = c_user.name.encode('utf-8') + customer_email = c.user_email items = subscription.get("items", {}).get("data", []) for item in items: subscription_name = item.get("plan", {}).get("id", "") @@ -100,6 +101,8 @@ class Command(BaseCommand): # Writing to CSV writer.writerow({ "customer_name": customer_name, + "customer_email": customer_email, + "stripe_customer_id": stripe_customer_id, "subscription_id": subscription_id, "subscription_name": subscription_name, "amount": amount_in_chf,