Fix obtaining correct CustomUSer

This commit is contained in:
PCoder 2023-12-27 19:49:50 +05:30
parent 36b091700e
commit 94a81fc976

View file

@ -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", [])