change some code
This commit is contained in:
parent
208d7d51df
commit
45d15919cf
|
@ -363,10 +363,8 @@ def checkout(request):
|
||||||
|
|
||||||
# Here we handle all POST Operations:
|
# Here we handle all POST Operations:
|
||||||
if request.method == 'POST':
|
if request.method == 'POST':
|
||||||
print('checkout post', request.POST)
|
|
||||||
# here we react to a change of amount per item in the Cart:
|
# here we react to a change of amount per item in the Cart:
|
||||||
if 'checkout' in request.POST:
|
if 'checkout' in request.POST:
|
||||||
print('checkout post request.POST = checkout_form')
|
|
||||||
checkout_form = CheckoutForm(request.POST)
|
checkout_form = CheckoutForm(request.POST)
|
||||||
if checkout_form.is_valid():
|
if checkout_form.is_valid():
|
||||||
orderstatus = OrderStatus.objects.get(name='ordered')
|
orderstatus = OrderStatus.objects.get(name='ordered')
|
||||||
|
@ -386,8 +384,7 @@ def checkout(request):
|
||||||
amount=position.amount,
|
amount=position.amount,
|
||||||
price_in_chf=position.article.price_in_chf
|
price_in_chf=position.article.price_in_chf
|
||||||
)
|
)
|
||||||
cart.delete()
|
return HttpResponseRedirect('/order/')
|
||||||
cart = False
|
|
||||||
|
|
||||||
return render(request, 'webshop/checkout.html',
|
return render(request, 'webshop/checkout.html',
|
||||||
{'cart_position_list': cart_position_list,
|
{'cart_position_list': cart_position_list,
|
||||||
|
|
Loading…
Reference in New Issue