Saleor Core: the high performance, composable, headless commerce API.
Python cartcheckoutcommercecomposablee-commerceecommercegraphqlheadlessheadless-commercemultichannelomsorder-managementpaymentspimpythonshopshopping-cartstore
Move ajax select2 fields to dashboard code
Anna Siwik777f1439b071
diff --git a/saleor/dashboard/discount/forms.py b/saleor/dashboard/discount/forms.pyindex 2dee739cb5..a2b1382f07 100644--- a/saleor/dashboard/discount/forms.py+++ b/saleor/dashboard/discount/forms.py@@ -6,12 +6,12 @@ from django.urls import reverse_lazyfrom django.utils.translation import pgettext_lazyfrom django_prices.forms import PriceField-from ...core.forms import (- AjaxSelect2ChoiceField, AjaxSelect2MultipleChoiceField)from ...discount import DiscountValueType, VoucherApplyToProductfrom ...discount.models import Sale, Voucherfrom ...product.models import Productfrom ...shipping.models import ShippingMethodCountry, COUNTRY_CODE_CHOICES+from ..forms import (+ AjaxSelect2ChoiceField, AjaxSelect2MultipleChoiceField)class SaleForm(forms.ModelForm):diff --git a/saleor/core/forms.py b/saleor/dashboard/forms.pysimilarity index 98%rename from saleor/core/forms.pyrename to saleor/dashboard/forms.pyindex d493c6db7e..4df7a96f32 100644--- a/saleor/core/forms.py+++ b/saleor/dashboard/forms.py@@ -1,6 +1,7 @@import jsonfrom django import forms+from django.core.exceptions import ValidationErrorclass AjaxSelect2ChoiceField(forms.ChoiceField):diff --git a/saleor/dashboard/order/forms.py b/saleor/dashboard/order/forms.pyindex 0c18ec5eda..6007d291fc 100644--- a/saleor/dashboard/order/forms.py+++ b/saleor/dashboard/order/forms.py@@ -7,9 +7,7 @@ from django_prices.forms import PriceFieldfrom payments import PaymentError, PaymentStatusfrom satchless.item import InsufficientStock-from ..widgets import PhonePrefixWidgetfrom ...cart.forms import QuantityField-from ...core.forms import AjaxSelect2ChoiceFieldfrom ...discount.utils import decrease_voucher_usagefrom ...order import GroupStatusfrom ...order.models import DeliveryGroup, OrderLine, OrderNote@@ -19,8 +17,10 @@ from ...order.utils import (recalculate_order, remove_empty_groups)from ...product.models import Product, ProductVariant, Stockfrom ...product.utils import allocate_stock, deallocate_stock-from ...userprofile.i18n import (AddressForm as StorefrontAddressForm,- PossiblePhoneNumberFormField)+from ...userprofile.i18n import (+ AddressForm as StorefrontAddressForm, PossiblePhoneNumberFormField)+from ..forms import AjaxSelect2ChoiceField+from ..widgets import PhonePrefixWidgetclass OrderNoteForm(forms.ModelForm):