Browse Source

Djano admin tweaks

pull/20/head
Pēteris Caune 9 years ago
parent
commit
88818c94b5
2 changed files with 7 additions and 2 deletions
  1. +4
    -1
      hc/payments/admin.py
  2. +3
    -1
      hc/payments/views.py

+ 4
- 1
hc/payments/admin.py View File

@ -5,4 +5,7 @@ from .models import Subscription
@admin.register(Subscription) @admin.register(Subscription)
class SubsAdmin(admin.ModelAdmin): 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

+ 3
- 1
hc/payments/views.py View File

@ -50,7 +50,9 @@ def create_plan(request):
sub = Subscription.objects.get(user=request.user) sub = Subscription.objects.get(user=request.user)
if not sub.customer_id: if not sub.customer_id:
result = braintree.Customer.create({})
result = braintree.Customer.create({
"email": request.user.email
})
if not result.is_success: if not result.is_success:
return log_and_bail(request, result) return log_and_bail(request, result)


Loading…
Cancel
Save