prompt: You will be provided with a partial code base and an issue statement explaining a problem to resolve.
  <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.
  
  
  </issue>
  <code>
  [start of saleor/dashboard/staff/forms.py]
  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 of saleor/dashboard/staff/forms.py]
  </code>
  
  I need you to solve this issue by generating a single patch file that I can apply directly to this repository using git apply. Please respond with a single patch file in the following format.
  <patch>
  diff --git a/file.py b/file.py
  --- a/file.py
  +++ b/file.py
  @@ -1,27 +1,35 @@
   def euclidean(a, b):
  -    while b:
  -        a, b = b, a % b
  -    return a
  +    if b == 0:
  +        return a
  +    return euclidean(b, a % b)
   
   
   def bresenham(x0, y0, x1, y1):
       points = []
       dx = abs(x1 - x0)
       dy = abs(y1 - y0)
  -    sx = 1 if x0 < x1 else -1
  -    sy = 1 if y0 < y1 else -1
  -    err = dx - dy
  +    x, y = x0, y0
  +    sx = -1 if x0 > x1 else 1
  +    sy = -1 if y0 > y1 else 1
   
  -    while True:
  -        points.append((x0, y0))
  -        if x0 == x1 and y0 == y1:
  -            break
  -        e2 = 2 * err
  -        if e2 > -dy:
  -            err -= dy
  -            x0 += sx
  -        if e2 < dx:
  -            err += dx
  -            y0 += sy
  +    if dx > dy:
  +        err = dx / 2.0
  +        while x != x1:
  +            points.append((x, y))
  +            err -= dy
  +            if err < 0:
  +                y += sy
  +                err += dx
  +            x += sx
  +    else:
  +        err = dy / 2.0
  +        while y != y1:
  +            points.append((x, y))
  +            err -= dx
  +            if err < 0:
  +                x += sx
  +                err += dy
  +            y += sy
  +
  +    points.append((x, y))
       return points
  
  </patch>
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"}]}