chore: refactor settings
This commit is contained in:
+12
-16
@@ -22,20 +22,18 @@ def create_order_line_for_product(product: Product, quantity: Decimal, tax: Tax)
|
||||
|
||||
|
||||
def create_order(
|
||||
customer: Customer,
|
||||
lines: Iterable,
|
||||
|
||||
billing_address: str,
|
||||
billing_city: str,
|
||||
billing_state: str,
|
||||
billing_country: str,
|
||||
billing_zip: str,
|
||||
|
||||
shipping_address: str = '',
|
||||
shipping_city: str = '',
|
||||
shipping_state: str = '',
|
||||
shipping_country: str = '',
|
||||
shipping_zip: str = '',
|
||||
customer: Customer,
|
||||
lines: Iterable,
|
||||
billing_address: str,
|
||||
billing_city: str,
|
||||
billing_state: str,
|
||||
billing_country: str,
|
||||
billing_zip: str,
|
||||
shipping_address: str = "",
|
||||
shipping_city: str = "",
|
||||
shipping_state: str = "",
|
||||
shipping_country: str = "",
|
||||
shipping_zip: str = "",
|
||||
) -> Order:
|
||||
billing_address = billing_address if billing_address else customer.address
|
||||
billing_city = billing_city if billing_city else customer.city
|
||||
@@ -51,13 +49,11 @@ def create_order(
|
||||
|
||||
order = Order.objects.create(
|
||||
customer=customer,
|
||||
|
||||
billing_address=billing_address,
|
||||
billing_city=billing_city,
|
||||
billing_state=billing_state,
|
||||
billing_country=billing_country,
|
||||
billing_zip=billing_zip,
|
||||
|
||||
shipping_address=shipping_address,
|
||||
shipping_city=shipping_city,
|
||||
shipping_state=shipping_state,
|
||||
|
||||
Reference in New Issue
Block a user