diff --git a/shop/views.py b/shop/views.py index 8b14d7df..6dc4cf46 100644 --- a/shop/views.py +++ b/shop/views.py @@ -39,6 +39,7 @@ class EnsureUserOwnsOrderMixin(SingleObjectMixin): request, *args, **kwargs ) + class EnsureUnpaidOrderMixin(SingleObjectMixin): model = Order @@ -51,6 +52,7 @@ class EnsureUnpaidOrderMixin(SingleObjectMixin): request, *args, **kwargs ) + class ShopIndexView(ListView): model = Product template_name = "shop_index.html" @@ -205,10 +207,6 @@ class CoinifyRedirectView(LoginRequiredMixin, EnsureUserOwnsOrderMixin, EnsureUn messages.error(request, 'This order is still open!') return HttpResponseRedirect('shop:order_detail') - if order.paid: - messages.error(request, 'This order is already paid for!') - return HttpResponseRedirect('shop:order_detail') - if not order.products.count() > 0: messages.error(request, 'This order contains no products!') return HttpResponseRedirect('shop:order_detail')