change some code

This commit is contained in:
Andreas Zweili 2018-02-27 18:40:05 +01:00
parent 208d7d51df
commit 45d15919cf
1 changed files with 1 additions and 4 deletions

View File

@ -363,10 +363,8 @@ def checkout(request):
# Here we handle all POST Operations:
if request.method == 'POST':
print('checkout post', request.POST)
# here we react to a change of amount per item in the Cart:
if 'checkout' in request.POST:
print('checkout post request.POST = checkout_form')
checkout_form = CheckoutForm(request.POST)
if checkout_form.is_valid():
orderstatus = OrderStatus.objects.get(name='ordered')
@ -386,8 +384,7 @@ def checkout(request):
amount=position.amount,
price_in_chf=position.article.price_in_chf
)
cart.delete()
cart = False
return HttpResponseRedirect('/order/')
return render(request, 'webshop/checkout.html',
{'cart_position_list': cart_position_list,