aboutsummaryrefslogtreecommitdiffstats
path: root/pyblackbird_cc/payments/views.py
diff options
context:
space:
mode:
Diffstat (limited to 'pyblackbird_cc/payments/views.py')
-rw-r--r--pyblackbird_cc/payments/views.py11
1 files changed, 7 insertions, 4 deletions
diff --git a/pyblackbird_cc/payments/views.py b/pyblackbird_cc/payments/views.py
index 36f1d84..28ad10d 100644
--- a/pyblackbird_cc/payments/views.py
+++ b/pyblackbird_cc/payments/views.py
@@ -17,9 +17,6 @@ from .models import ShoppingCart
stripe.api_key = settings.STRIPE_SECRET_KEY
-def cart(request):
- cart = ShoppingCart.objects.get(user=request.user)
- return render(request, "cart_detail.html", {"cart": cart})
class CreateCheckoutSessionView(View):
@@ -69,12 +66,18 @@ def add_to_cart(request, resource_id):
cart_item.save()
return redirect("cart_detail")
-
@login_required
def cart_detail(request):
cart, created = ShoppingCart.objects.get_or_create(user=request.user)
+ # TODO Here we need to iterate over cart_items and extract metadata
+ # for each one so that we can access thumbnails in the template
+ #resource_metadata = _extract_metadata_from_resource(resource_obj)
return render(request, "payments/cart_detail.html", {"cart": cart})
+# def cart_detail(request):
+# cart, created = ShoppingCart.objects.get_or_create(user=request.user)
+# return render(request, "payments/cart_detail.html", {"cart": cart})
+
@login_required
def checkout(request):