Skip to content

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

Resolve name conflict and reorder imports

dominik-zeglendff9fc2fcade
diff --git a/saleor/dashboard/order/forms.py b/saleor/dashboard/order/forms.py
index 74d42cdfda..0c18ec5eda 100644
--- a/saleor/dashboard/order/forms.py
+++ b/saleor/dashboard/order/forms.py
@@ -19,7 +19,8 @@ from ...order.utils import (
recalculate_order, remove_empty_groups)
from ...product.models import Product, ProductVariant, Stock
from ...product.utils import allocate_stock, deallocate_stock
-from ...userprofile.i18n import AddressForm, PossiblePhoneNumberFormField
+from ...userprofile.i18n import (AddressForm as StorefrontAddressForm,
+ PossiblePhoneNumberFormField)
class OrderNoteForm(forms.ModelForm):
@@ -372,6 +373,6 @@ class AddVariantToDeliveryGroupForm(forms.Form):
recalculate_order(self.group.order)
-class DashboardAddressForm(AddressForm):
+class AddressForm(StorefrontAddressForm):
phone = PossiblePhoneNumberFormField(
widget=PhonePrefixWidget, required=False)
diff --git a/saleor/dashboard/order/views.py b/saleor/dashboard/order/views.py
index 074a80990a..6b538e5265 100644
--- a/saleor/dashboard/order/views.py
+++ b/saleor/dashboard/order/views.py
@@ -14,10 +14,10 @@ from satchless.item import InsufficientStock
from .filters import OrderFilter
from .forms import (
- AddVariantToDeliveryGroupForm, CancelGroupForm, CancelOrderLineForm,
- CancelOrderForm, CapturePaymentForm, ChangeStockForm, ChangeQuantityForm,
- MoveLinesForm, OrderNoteForm, RefundPaymentForm, ReleasePaymentForm,
- RemoveVoucherForm, ShipGroupForm, DashboardAddressForm)
+ AddressForm, AddVariantToDeliveryGroupForm, CancelGroupForm,
+ CancelOrderLineForm, CancelOrderForm, CapturePaymentForm,
+ ChangeStockForm, ChangeQuantityForm, MoveLinesForm, OrderNoteForm,
+ RefundPaymentForm, ReleasePaymentForm, RemoveVoucherForm, ShipGroupForm)
from .utils import (
create_invoice_pdf, create_packing_slip_pdf, get_statics_absolute_url)
@@ -351,7 +351,7 @@ def address_view(request, order_pk, address_type):
success_msg = pgettext_lazy(
'Dashboard message',
'Updated billing address')
- form = DashboardAddressForm(request.POST or None, instance=address)
+ form = AddressForm(request.POST or None, instance=address)
if form.is_valid():
form.save()
order.create_history_entry(comment=success_msg, user=request.user)