only check if terms are checked when payment method buttons are used
This commit is contained in:
parent
809df2e952
commit
9102796e6e
|
@ -255,14 +255,13 @@ class OrderDetailView(
|
||||||
order = self.get_object()
|
order = self.get_object()
|
||||||
payment_method = request.POST.get('payment_method')
|
payment_method = request.POST.get('payment_method')
|
||||||
|
|
||||||
if not request.POST.get('accept_terms'):
|
|
||||||
messages.error(request, "You need to accept the general terms and conditions before you can continue!")
|
|
||||||
return HttpResponseRedirect(reverse_lazy('shop:order_detail', kwargs={'pk': order.pk}))
|
|
||||||
|
|
||||||
if payment_method in order.PAYMENT_METHODS:
|
if payment_method in order.PAYMENT_METHODS:
|
||||||
order.payment_method = payment_method
|
if not request.POST.get('accept_terms'):
|
||||||
|
messages.error(request, "You need to accept the general terms and conditions before you can continue!")
|
||||||
|
return HttpResponseRedirect(reverse_lazy('shop:order_detail', kwargs={'pk': order.pk}))
|
||||||
|
|
||||||
# Mark the order as closed
|
# Set payment method and mark the order as closed
|
||||||
|
order.payment_method = payment_method
|
||||||
order.open = None
|
order.open = None
|
||||||
order.save()
|
order.save()
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue