only create the order

This commit is contained in:
Andreas Zweili 2018-02-26 21:54:40 +01:00
parent 3970555cf1
commit f62a6a91d9
1 changed files with 6 additions and 9 deletions

View File

@ -337,15 +337,12 @@ def checkout(request):
if checkout_form.is_valid(): if checkout_form.is_valid():
orderstatus = OrderStatus.objects.get(name='ordered') orderstatus = OrderStatus.objects.get(name='ordered')
print('checkout post valid orderstatus', orderstatus, print('checkout post valid orderstatus', orderstatus,
'exchange_rate_id:', exchange_rate_id) 'exchange_rate:', exchange_rate)
order, created_order = Order.objects.get_or_create( order = Order.objects.create(user=request.user,
user=request.user, status=orderstatus,
defaults={'status': orderstatus, exchange_rate=exchange_rate)
'exchange_rate': exchange_rate, print('order', order, 'created:', order)
} if order is False:
)
print('order', order, 'created:', created_order)
if created_order is False:
message = """something whent wrong. message = """something whent wrong.
Seams like this cart was already submitted. How come? """ Seams like this cart was already submitted. How come? """
# order status variables: # order status variables: