From 94a81fc976243a4847fda83a50fa56b0f6d31c1c Mon Sep 17 00:00:00 2001 From: PCoder Date: Wed, 27 Dec 2023 19:49:50 +0530 Subject: [PATCH] Fix obtaining correct CustomUSer --- hosting/management/commands/change_ch_vatrate_2023.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hosting/management/commands/change_ch_vatrate_2023.py b/hosting/management/commands/change_ch_vatrate_2023.py index 93920904..e397a208 100644 --- a/hosting/management/commands/change_ch_vatrate_2023.py +++ b/hosting/management/commands/change_ch_vatrate_2023.py @@ -89,7 +89,7 @@ class Command(BaseCommand): stripe_customer_id = subscription.get("customer", "") vat_rate = subscription.get("tax_percent", "") c_user = CustomUser.objects.get( - id=StripeCustomer.objects.filter(stripe_id=stripe_customer_id)[0].id) + id=StripeCustomer.objects.filter(stripe_id=stripe_customer_id)[0].user.id) customer_name = c_user.name.encode('utf-8') customer_email = c_user.email items = subscription.get("items", {}).get("data", [])