Skip to content

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

Remove is_staff property from staff member form

Anna Siwiked0b8e7b781c
diff --git a/saleor/dashboard/staff/forms.py b/saleor/dashboard/staff/forms.py
index a5a5f90eff..9aa9262960 100644
--- a/saleor/dashboard/staff/forms.py
+++ b/saleor/dashboard/staff/forms.py
@@ -7,21 +7,18 @@ from ...userprofile.models import User
class 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 = True
if self.user == self.instance:
- self.fields['is_staff'].disabled = True
self.fields['is_active'].disabled = True
class 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')}