chore: refactor settings

This commit is contained in:
2024-03-24 20:59:23 +01:00
parent 05ece2c074
commit 6b04fe7e23
8 changed files with 57 additions and 41 deletions
+12 -16
View File
@@ -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,