Saleor Core: the high performance, composable, headless commerce API.
Python cartcheckoutcommercecomposablee-commerceecommercegraphqlheadlessheadless-commercemultichannelomsorder-managementpaymentspimpythonshopshopping-cartstore
Improve readability
Marcin Gębala73cd8bf68755
diff --git a/saleor/dashboard/order/forms.py b/saleor/dashboard/order/forms.pyindex 4ff700b05f..6a1bf7f0ee 100644--- a/saleor/dashboard/order/forms.py+++ b/saleor/dashboard/order/forms.py@@ -49,8 +49,7 @@ class MoveItemsForm(forms.Form):self.item = kwargs.pop('item')super(MoveItemsForm, self).__init__(*args, **kwargs)self.fields['how_many'].widget.attrs.update({- 'max': self.item.quantity,- 'min': 1})+ 'max': self.item.quantity, 'min': 1})self.fields['groups'].choices = self.get_delivery_group_choices()def get_delivery_group_choices(self):@@ -82,9 +81,8 @@ class ChangeQuantityForm(forms.ModelForm):def __init__(self, *args, **kwargs):super(ChangeQuantityForm, self).__init__(*args, **kwargs)self.fields['quantity'].widget.attrs.update({- 'max': self.instance.quantity,- 'min': 1})- self.fields['quantity'].initial = self.initial_quantity+ 'max': self.instance.quantity, 'min': 1})+ self.fields['quantity'].initial = self.instance.quantitydef get_variant(self):p = Product.objects.select_subclasses().get(pk=self.instance.product.pk)