Skip to content

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

Remove is_staff from customer form

Unknown4616ee0bf719
diff --git a/saleor/dashboard/customer/forms.py b/saleor/dashboard/customer/forms.py
index 34e56e1789..b0ef0c2503 100644
--- a/saleor/dashboard/customer/forms.py
+++ b/saleor/dashboard/customer/forms.py
@@ -45,20 +45,11 @@ class CustomerForm(forms.ModelForm):
self.user = kwargs.pop('user', None)
super().__init__(*args, **kwargs)
- # Only user with managing staff privilege or superuser
- # can assign other user as staff
- self.fields['is_staff'].disabled = True
- if self.user and (
- self.user.has_perms(['account.manage_staff'])
- or self.user.is_superuser):
- self.fields['is_staff'].disabled = False
-
# Disable editing following fields if user edits his own account
if self.user == self.instance:
self.fields['email'].disabled = True
self.fields['note'].disabled = True
self.fields['is_active'].disabled = True
- self.fields['is_staff'].disabled = True
address = self.instance.default_billing_address
if not address:
@@ -73,8 +64,7 @@ class CustomerForm(forms.ModelForm):
class Meta:
model = User
fields = [
- 'first_name', 'last_name', 'email', 'note',
- 'is_active', 'is_staff']
+ 'first_name', 'last_name', 'email', 'note', 'is_active']
labels = {
'first_name': pgettext_lazy(
'Customer form: Given name field', 'Given name'),