feat: reset migrations and created customer address model
This commit is contained in:
+5
-2
@@ -1,6 +1,9 @@
|
||||
from decimal import Decimal
|
||||
|
||||
from shop.models import Customer, Order, OrderLine, Product, ProductBatch
|
||||
from django.contrib.auth import get_user_model
|
||||
|
||||
User = get_user_model()
|
||||
|
||||
|
||||
def create_order_line_for_product(product: Product, quantity: Decimal, order: Order):
|
||||
@@ -22,7 +25,7 @@ def create_order_line_for_product(product: Product, quantity: Decimal, order: Or
|
||||
|
||||
|
||||
def create_order(
|
||||
customer: Customer,
|
||||
customer: User,
|
||||
billing_address: str,
|
||||
billing_city: str,
|
||||
billing_state: str,
|
||||
@@ -47,7 +50,7 @@ def create_order(
|
||||
shipping_zip = shipping_zip if shipping_zip else billing_zip
|
||||
|
||||
order = Order.objects.create(
|
||||
customer=customer,
|
||||
user=customer,
|
||||
billing_address=billing_address,
|
||||
billing_city=billing_city,
|
||||
billing_state=billing_state,
|
||||
|
||||
Reference in New Issue
Block a user