From e74ff1d9a39c471ef8dca34732319e1361263ff9 Mon Sep 17 00:00:00 2001 From: Matthew Lemon Date: Sun, 22 Sep 2024 08:45:39 +0100 Subject: very minor format changes --- pyblackbird_cc/payments/views.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'pyblackbird_cc/payments/views.py') diff --git a/pyblackbird_cc/payments/views.py b/pyblackbird_cc/payments/views.py index 01400bb..40c2380 100644 --- a/pyblackbird_cc/payments/views.py +++ b/pyblackbird_cc/payments/views.py @@ -17,8 +17,6 @@ from .models import ShoppingCart stripe.api_key = settings.STRIPE_SECRET_KEY - - class CreateCheckoutSessionView(View): def post(self, request, *args, **kwargs): price = Price.objects.get(id=self.kwargs["pk"]) @@ -66,11 +64,13 @@ 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) 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}) -- cgit v1.2.3