prompt: You will be provided with a partial code base and an issue statement explaining a problem to resolve.
  <issue>
  Don't revoke staff status for superusers
  ### Describe the bug
  After #312, staff status will get revoked for superusers too. That shouldn't happen
  
  ### How to reproduce
  Have a super user that is not in a committee.
  
  ### Expected behaviour
  No staff status revoking
  
  ### Screenshots
  
  ### Additional context
  
  
  </issue>
  <code>
  [start of website/activemembers/services.py]
  1 from django.db.models import Count, Q
  2 from django.utils import timezone
  3 
  4 from activemembers.models import Committee
  5 from members.models.member import Member
  6 
  7 
  8 def generate_statistics() -> dict:
  9     """Generate statistics about number of members in each committee."""
  10     committees = Committee.active_objects.annotate(
  11         member_count=(
  12             Count(
  13                 "members",
  14                 filter=(
  15                     Q(membergroupmembership__until=None)
  16                     | Q(membergroupmembership__until__gte=timezone.now())
  17                 ),
  18             )
  19         )
  20     )
  21 
  22     data = {
  23         "labels": [],
  24         "datasets": [
  25             {"data": []},
  26         ],
  27     }
  28     for committee in committees:
  29         data["labels"].append(committee.name)
  30         data["datasets"][0]["data"].append(committee.member_count)
  31 
  32     return data
  33 
  34 
  35 def revoke_staff_permission_for_users_in_no_commitee():
  36     members = Member.objects.filter(is_staff=True)
  37     revoked = []
  38     for member in members:
  39         if member.get_member_groups().count() == 0:
  40             revoked.append(member.id)
  41             member.is_staff = False
  42             member.save()
  43     return Member.objects.filter(pk__in=revoked)
  44
  [end of website/activemembers/services.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/website/activemembers/services.py b/website/activemembers/services.py
  --- a/website/activemembers/services.py
  +++ b/website/activemembers/services.py
  @@ -36,7 +36,7 @@
       members = Member.objects.filter(is_staff=True)
       revoked = []
       for member in members:
  -        if member.get_member_groups().count() == 0:
  +        if member.get_member_groups().count() == 0 and not member.is_superuser:
               revoked.append(member.id)
               member.is_staff = False
               member.save()
  
verification_info: {"golden_diff": "diff --git a/website/activemembers/services.py b/website/activemembers/services.py\n--- a/website/activemembers/services.py\n+++ b/website/activemembers/services.py\n@@ -36,7 +36,7 @@\n     members = Member.objects.filter(is_staff=True)\n     revoked = []\n     for member in members:\n-        if member.get_member_groups().count() == 0:\n+        if member.get_member_groups().count() == 0 and not member.is_superuser:\n             revoked.append(member.id)\n             member.is_staff = False\n             member.save()\n", "issue": "Don't revoke staff status for superusers\n### Describe the bug\r\nAfter #312, staff status will get revoked for superusers too. That shouldn't happen\r\n\r\n### How to reproduce\r\nHave a super user that is not in a committee.\r\n\r\n### Expected behaviour\r\nNo staff status revoking\r\n\r\n### Screenshots\r\n\r\n### Additional context\r\n\n", "before_files": [{"content": "from django.db.models import Count, Q\nfrom django.utils import timezone\n\nfrom activemembers.models import Committee\nfrom members.models.member import Member\n\n\ndef generate_statistics() -> dict:\n    \"\"\"Generate statistics about number of members in each committee.\"\"\"\n    committees = Committee.active_objects.annotate(\n        member_count=(\n            Count(\n                \"members\",\n                filter=(\n                    Q(membergroupmembership__until=None)\n                    | Q(membergroupmembership__until__gte=timezone.now())\n                ),\n            )\n        )\n    )\n\n    data = {\n        \"labels\": [],\n        \"datasets\": [\n            {\"data\": []},\n        ],\n    }\n    for committee in committees:\n        data[\"labels\"].append(committee.name)\n        data[\"datasets\"][0][\"data\"].append(committee.member_count)\n\n    return data\n\n\ndef revoke_staff_permission_for_users_in_no_commitee():\n    members = Member.objects.filter(is_staff=True)\n    revoked = []\n    for member in members:\n        if member.get_member_groups().count() == 0:\n            revoked.append(member.id)\n            member.is_staff = False\n            member.save()\n    return Member.objects.filter(pk__in=revoked)\n", "path": "website/activemembers/services.py"}]}