check that this order belongs to this user
This commit is contained in:
parent
bbee72c67f
commit
29c0696f3f
|
@ -35,6 +35,11 @@ class CheckoutView(LoginRequiredMixin, DetailView):
|
|||
template_name = 'shop/order_detail.html'
|
||||
context_object_name = 'order'
|
||||
|
||||
def get(self, request, *args, **kwargs):
|
||||
if self.get_object().user != request.user:
|
||||
raise Http404("Order not found")
|
||||
return self.render_to_response(self.get_context_data())
|
||||
|
||||
|
||||
class PaymentView(LoginRequiredMixin, FormView):
|
||||
"""
|
||||
|
|
Loading…
Reference in a new issue