diff options
author | Matthew Lemon <y@yulqen.org> | 2024-09-19 19:52:02 +0100 |
---|---|---|
committer | Matthew Lemon <y@yulqen.org> | 2024-09-19 19:52:02 +0100 |
commit | 51bbea4361d4fafe93997ed0f3dae05be8389c96 (patch) | |
tree | ea180b511a9fe76127dc7f60acd5cf74352c40de /pyblackbird_cc/payments | |
parent | 8c0cbec4a801771c2eda26bba54d4cfcf95ca9d7 (diff) |
wip: getting the thumbnails of resources
Diffstat (limited to 'pyblackbird_cc/payments')
-rw-r--r-- | pyblackbird_cc/payments/views.py | 11 |
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): |