Skip to content

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

Remove nedless dependency on importing prices.Money in order migration for better forward compatibility

Rafał Pitońf874cb912811
diff --git a/saleor/order/migrations/0039_auto_20180312_1203.py b/saleor/order/migrations/0039_auto_20180312_1203.py
index bf28d8bbbf..3096fd8686 100644
--- a/saleor/order/migrations/0039_auto_20180312_1203.py
+++ b/saleor/order/migrations/0039_auto_20180312_1203.py
@@ -3,7 +3,6 @@
from decimal import Decimal
from django.db import migrations
import django_prices.models
-import prices
class Migration(migrations.Migration):
@@ -16,11 +15,11 @@ class Migration(migrations.Migration):
migrations.AlterField(
model_name='order',
name='total_gross',
- field=django_prices.models.MoneyField(currency='USD', decimal_places=2, default=prices.Money('0', currency='USD'), max_digits=12),
+ field=django_prices.models.MoneyField(currency='USD', decimal_places=2, default=0, max_digits=12),
),
migrations.AlterField(
model_name='order',
name='total_net',
- field=django_prices.models.MoneyField(currency='USD', decimal_places=2, default=prices.Money('0', currency='USD'), max_digits=12),
+ field=django_prices.models.MoneyField(currency='USD', decimal_places=2, default=0, max_digits=12),
),
]
diff --git a/saleor/order/models.py b/saleor/order/models.py
index b6a5c82ad6..6003e90fa2 100644
--- a/saleor/order/models.py
+++ b/saleor/order/models.py
@@ -66,10 +66,10 @@ class Order(models.Model):
token = models.CharField(max_length=36, unique=True)
total_net = MoneyField(
currency=settings.DEFAULT_CURRENCY, max_digits=12, decimal_places=2,
- default=Money(0, settings.DEFAULT_CURRENCY))
+ default=0)
total_gross = MoneyField(
currency=settings.DEFAULT_CURRENCY, max_digits=12, decimal_places=2,
- default=Money(0, settings.DEFAULT_CURRENCY))
+ default=0)
total = TaxedMoneyField(net_field='total_net', gross_field='total_gross')
voucher = models.ForeignKey(
Voucher, null=True, related_name='+', on_delete=models.SET_NULL)