prompt: We are currently solving the following issue within our repository. Here is the issue text:
  --- BEGIN ISSUE ---
  Superuser can change his status
  In `StaffForm`:
  https://github.com/mirumee/saleor/blob/master/saleor/dashboard/staff/forms.py#L12-L13
  Widget is disabled `self.fields['is_staff'].widget.attrs['disabled'] = True` 
  But it won't prevent you from changing values on POST.
  We should disable field instead, like `self.fields['is_active'].disabled = True` 
  Test covering this would be nice as well.
  
  
  --- END ISSUE ---
  
  Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
  --- BEGIN FILES ---
  Path: `saleor/dashboard/staff/forms.py`
  Content:
  ```
  1 from django import forms
  2 
  3 from ...userprofile.models import User
  4 
  5 
  6 class StaffForm(forms.ModelForm):
  7     def __init__(self, *args, **kwargs):
  8         self.user = kwargs.pop('user', None)
  9         kwargs.update(initial={'is_staff': True})
  10         super(StaffForm, self).__init__(*args, **kwargs)
  11         if self.user == self.instance:
  12             self.fields['is_staff'].widget.attrs['disabled'] = True
  13             self.fields['is_active'].widget.attrs['disabled'] = True
  14 
  15     class Meta:
  16         model = User
  17         fields = ['email', 'groups', 'is_staff', 'is_active']
  18
  ```
  --- END FILES ---
  
  Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.
  
  Here is an example:
  
  ```diff
  diff --git a/examples/server_async.py b/examples/server_async.py
  --- a/examples/server_async.py
  +++ b/examples/server_async.py
  @@ -313,4 +313,4 @@
   
   
   if __name__ == "__main__":
  -    asyncio.run(run_async_server("."), debug=True)
  +    asyncio.run(run_async_server(), debug=True)
  diff --git a/examples/server_sync.py b/examples/server_sync.py
  --- a/examples/server_sync.py
  +++ b/examples/server_sync.py
  @@ -313,5 +313,5 @@
   
   
   if __name__ == "__main__":
  -    server = run_sync_server(".")
  +    server = run_sync_server()
       server.shutdown()
  
  ```
  
golden_diff: diff --git a/saleor/dashboard/staff/forms.py b/saleor/dashboard/staff/forms.py
  --- a/saleor/dashboard/staff/forms.py
  +++ b/saleor/dashboard/staff/forms.py
  @@ -9,8 +9,8 @@
           kwargs.update(initial={'is_staff': True})
           super(StaffForm, self).__init__(*args, **kwargs)
           if self.user == self.instance:
  -            self.fields['is_staff'].widget.attrs['disabled'] = True
  -            self.fields['is_active'].widget.attrs['disabled'] = True
  +            self.fields['is_staff'].disabled = True
  +            self.fields['is_active'].disabled = True
   
       class Meta:
           model = User
  
verification_info: {"golden_diff": "diff --git a/saleor/dashboard/staff/forms.py b/saleor/dashboard/staff/forms.py\n--- a/saleor/dashboard/staff/forms.py\n+++ b/saleor/dashboard/staff/forms.py\n@@ -9,8 +9,8 @@\n         kwargs.update(initial={'is_staff': True})\n         super(StaffForm, self).__init__(*args, **kwargs)\n         if self.user == self.instance:\n-            self.fields['is_staff'].widget.attrs['disabled'] = True\n-            self.fields['is_active'].widget.attrs['disabled'] = True\n+            self.fields['is_staff'].disabled = True\n+            self.fields['is_active'].disabled = True\n \n     class Meta:\n         model = User\n", "issue": "Superuser can change his status\nIn `StaffForm`:\r\nhttps://github.com/mirumee/saleor/blob/master/saleor/dashboard/staff/forms.py#L12-L13\r\nWidget is disabled `self.fields['is_staff'].widget.attrs['disabled'] = True` \r\nBut it won't prevent you from changing values on POST.\r\nWe should disable field instead, like `self.fields['is_active'].disabled = True` \r\nTest covering this would be nice as well.\r\n\n", "before_files": [{"content": "from django import forms\n\nfrom ...userprofile.models import User\n\n\nclass StaffForm(forms.ModelForm):\n    def __init__(self, *args, **kwargs):\n        self.user = kwargs.pop('user', None)\n        kwargs.update(initial={'is_staff': True})\n        super(StaffForm, self).__init__(*args, **kwargs)\n        if self.user == self.instance:\n            self.fields['is_staff'].widget.attrs['disabled'] = True\n            self.fields['is_active'].widget.attrs['disabled'] = True\n\n    class Meta:\n        model = User\n        fields = ['email', 'groups', 'is_staff', 'is_active']\n", "path": "saleor/dashboard/staff/forms.py"}], "after_files": [{"content": "from django import forms\n\nfrom ...userprofile.models import User\n\n\nclass StaffForm(forms.ModelForm):\n    def __init__(self, *args, **kwargs):\n        self.user = kwargs.pop('user', None)\n        kwargs.update(initial={'is_staff': True})\n        super(StaffForm, self).__init__(*args, **kwargs)\n        if self.user == self.instance:\n            self.fields['is_staff'].disabled = True\n            self.fields['is_active'].disabled = True\n\n    class Meta:\n        model = User\n        fields = ['email', 'groups', 'is_staff', 'is_active']\n", "path": "saleor/dashboard/staff/forms.py"}]}