diff --git a/hc/payments/admin.py b/hc/payments/admin.py index 67599c92..82dfb0a0 100644 --- a/hc/payments/admin.py +++ b/hc/payments/admin.py @@ -5,4 +5,7 @@ from .models import Subscription @admin.register(Subscription) class SubsAdmin(admin.ModelAdmin): - list_display = ("id", "user") + list_display = ("id", "email", "customer_id", "payment_method_token", "subscription_id") + + def email(self, obj): + return obj.user.email if obj.user else None diff --git a/hc/payments/views.py b/hc/payments/views.py index 49b54a19..a510b527 100644 --- a/hc/payments/views.py +++ b/hc/payments/views.py @@ -50,7 +50,9 @@ def create_plan(request): sub = Subscription.objects.get(user=request.user) if not sub.customer_id: - result = braintree.Customer.create({}) + result = braintree.Customer.create({ + "email": request.user.email + }) if not result.is_success: return log_and_bail(request, result)