Skip to content

Commit

Permalink
nablashop bak innlogging
Browse files Browse the repository at this point in the history
  • Loading branch information
Vemund Aakre committed Feb 8, 2024
1 parent ab3168e commit 8c70e02
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions nablapps/nablashop/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
from .models import Category, Order, OrderProduct, Product


class IndexView(ListView):
class IndexView(LoginRequiredMixin, ListView):
queryset = Product.objects.order_by("-pub_date")
template_name = "nablashop/index.html"

Expand All @@ -29,7 +29,7 @@ def get_context_data(self, **kwargs):
return context


class ProductDetailView(DetailView):
class ProductDetailView(LoginRequiredMixin, DetailView):
model = Product
template_name = "nablashop/product_detail.html"

Expand All @@ -39,7 +39,7 @@ def get_context_data(self, **kwargs):
return context


class CategoryDetailView(DetailView):
class CategoryDetailView(LoginRequiredMixin, DetailView):
model = Category
template_name = "nablashop/category_detail.html"

Expand Down Expand Up @@ -133,7 +133,7 @@ def remove_single_product_from_cart(request, slug):
return redirect("nablashop:product_detail", slug=slug)


class CheckoutView(TemplateView):
class CheckoutView(LoginRequiredMixin, TemplateView):
template_name = "nablashop/purchase.html"

def post(self, request, *args, **kwargs):
Expand Down

0 comments on commit 8c70e02

Please sign in to comment.