Skip to content

Saleor Core: the high performance, composable, headless commerce API.

Merge pull request #1243 from mirumee/fix/CheckoutDiscountFormQS

Marcin Gębala10c1010348b9
diff --cc saleor/checkout/core.py
index 1084c0790b,3e48566ad3..b88240895a
--- a/saleor/checkout/core.py
+++ b/saleor/checkout/core.py
@@@ -1,6 -1,6 +1,7 @@@
+"""Checkout session state management."""
from __future__ import unicode_literals
+ from datetime import date
from functools import wraps
from django.conf import settings
@@@ -263,20 -248,9 +264,21 @@@ class Checkout(object)
@transaction.atomic
def create_order(self):
+ """Create an order from the checkout session.
+
+ Each order will get a private copy of both the billing and the shipping
+ address (if shipping ).
+
+ If any of the addresses is new and the user is logged in the address
+ will also get saved to that user's address book.
+
+ Current user's language is saved in the order so we can later determine
+ which language to use when sending email.
+ """
+ # FIXME: save locale along with the language
voucher = self._get_voucher(
- vouchers=Voucher.objects.active().select_for_update())
+ vouchers=Voucher.objects.active(date=date.today())
+ .select_for_update())
if self.voucher_code is not None and voucher is None:
# Voucher expired in meantime, abort order placement
return