Saleor Core: the high performance, composable, headless commerce API.
Python cartcheckoutcommercecomposablee-commerceecommercegraphqlheadlessheadless-commercemultichannelomsorder-managementpaymentspimpythonshopshopping-cartstore
Remove is_staff property from staff member form
Anna Siwiked0b8e7b781c
diff --git a/saleor/dashboard/staff/forms.py b/saleor/dashboard/staff/forms.pyindex a5a5f90eff..9aa9262960 100644--- a/saleor/dashboard/staff/forms.py+++ b/saleor/dashboard/staff/forms.py@@ -7,21 +7,18 @@ from ...userprofile.models import Userclass StaffForm(forms.ModelForm):def __init__(self, *args, **kwargs):self.user = kwargs.pop('user', None)- kwargs.update(initial={'is_staff': True})super().__init__(*args, **kwargs)+ self.instance.is_staff = Trueif self.user == self.instance:- self.fields['is_staff'].disabled = Trueself.fields['is_active'].disabled = Trueclass Meta:model = User- fields = ['email', 'groups', 'is_staff', 'is_active']+ fields = ['email', 'groups', 'is_active']labels = {'email': pgettext_lazy('Email', 'Email'),'groups': pgettext_lazy('Groups', 'Groups'),'is_active': pgettext_lazy(- 'User active toggle', 'User is active'),- 'is_staff': pgettext_lazy(- 'User dashboard access toggle', 'Has access to dashboard')}+ 'User active toggle', 'User is active')}