prompt: You will be provided with a partial code base and an issue statement explaining a problem to resolve.
  <issue>
  Separate promotion permissions in eventadmin inline from the main promotion perms
  ### What?
  Currently, people need add/change_promotionrequest permission to make promotionrequests for their events. But with this permission they also get full access to all other promotionrequests. So we should make the inline in the eventadmin bypass that check. For all I care, anyone who can change an event can make a promorquest from the eventadmin (by virtue of their 'change_event' permission and being an organizer of the event), without having the add/change_promotionrequest permission, and thus without seeing the main Promotion Requests changelist page.
  
  ### Why?
  <!-- A clear and concise motivation why we should consider implementing this. -->
  Least privilege principle: many people should be allowed to request promotion for their own events, but don't need to be able to edit unrelated requests. And this way we can have promocie be able to bypass the requirements in #3529, without normal organizers being able to do the same.
  
  ### How?
  Override has_xxx_permission() on the inline class. Read the inlinemodeladmin docs for guidance.
  
  
  </issue>
  <code>
  [start of website/events/admin/inlines.py]
  1 from django.contrib import admin
  2 
  3 from events import models
  4 from pizzas.models import FoodEvent
  5 from promotion.models import PromotionRequest
  6 
  7 from .forms import RegistrationInformationFieldForm
  8 
  9 
  10 class RegistrationInformationFieldInline(admin.TabularInline):
  11     """The inline for registration information fields in the Event admin."""
  12 
  13     form = RegistrationInformationFieldForm
  14     extra = 0
  15     model = models.RegistrationInformationField
  16     ordering = ("_order",)
  17 
  18     radio_fields = {"type": admin.VERTICAL}
  19 
  20     def get_formset(self, request, obj=None, **kwargs):
  21         formset = super().get_formset(request, obj, **kwargs)
  22         if obj is not None:
  23             count = obj.registrationinformationfield_set.count()
  24             formset.form.declared_fields["order"].initial = count
  25         return formset
  26 
  27 
  28 class PizzaEventInline(admin.StackedInline):
  29     """The inline for pizza events in the Event admin."""
  30 
  31     model = FoodEvent
  32     extra = 0
  33     max_num = 1
  34 
  35 
  36 class PromotionRequestInline(admin.StackedInline):
  37     model = PromotionRequest
  38     readonly_fields = (
  39         "assigned_to",
  40         "status",
  41         "drive_folder",
  42     )
  43     extra = 0
  44
  [end of website/events/admin/inlines.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/events/admin/inlines.py b/website/events/admin/inlines.py
  --- a/website/events/admin/inlines.py
  +++ b/website/events/admin/inlines.py
  @@ -39,5 +39,19 @@
           "assigned_to",
           "status",
           "drive_folder",
  +        "status_updated",
       )
  +
  +    def has_add_permission(self, request, obj=None):
  +        return True
  +
  +    def has_view_permission(self, request, obj=None):
  +        return True
  +
  +    def has_change_permission(self, request, obj=None):
  +        return True
  +
  +    def has_delete_permission(self, request, obj=None):
  +        return True
  +
       extra = 0
  
verification_info: {"golden_diff": "diff --git a/website/events/admin/inlines.py b/website/events/admin/inlines.py\n--- a/website/events/admin/inlines.py\n+++ b/website/events/admin/inlines.py\n@@ -39,5 +39,19 @@\n         \"assigned_to\",\n         \"status\",\n         \"drive_folder\",\n+        \"status_updated\",\n     )\n+\n+    def has_add_permission(self, request, obj=None):\n+        return True\n+\n+    def has_view_permission(self, request, obj=None):\n+        return True\n+\n+    def has_change_permission(self, request, obj=None):\n+        return True\n+\n+    def has_delete_permission(self, request, obj=None):\n+        return True\n+\n     extra = 0\n", "issue": "Separate promotion permissions in eventadmin inline from the main promotion perms\n### What?\r\nCurrently, people need add/change_promotionrequest permission to make promotionrequests for their events. But with this permission they also get full access to all other promotionrequests. So we should make the inline in the eventadmin bypass that check. For all I care, anyone who can change an event can make a promorquest from the eventadmin (by virtue of their 'change_event' permission and being an organizer of the event), without having the add/change_promotionrequest permission, and thus without seeing the main Promotion Requests changelist page.\r\n\r\n### Why?\r\n<!-- A clear and concise motivation why we should consider implementing this. -->\r\nLeast privilege principle: many people should be allowed to request promotion for their own events, but don't need to be able to edit unrelated requests. And this way we can have promocie be able to bypass the requirements in #3529, without normal organizers being able to do the same.\r\n\r\n### How?\r\nOverride has_xxx_permission() on the inline class. Read the inlinemodeladmin docs for guidance.\r\n\n", "before_files": [{"content": "from django.contrib import admin\n\nfrom events import models\nfrom pizzas.models import FoodEvent\nfrom promotion.models import PromotionRequest\n\nfrom .forms import RegistrationInformationFieldForm\n\n\nclass RegistrationInformationFieldInline(admin.TabularInline):\n    \"\"\"The inline for registration information fields in the Event admin.\"\"\"\n\n    form = RegistrationInformationFieldForm\n    extra = 0\n    model = models.RegistrationInformationField\n    ordering = (\"_order\",)\n\n    radio_fields = {\"type\": admin.VERTICAL}\n\n    def get_formset(self, request, obj=None, **kwargs):\n        formset = super().get_formset(request, obj, **kwargs)\n        if obj is not None:\n            count = obj.registrationinformationfield_set.count()\n            formset.form.declared_fields[\"order\"].initial = count\n        return formset\n\n\nclass PizzaEventInline(admin.StackedInline):\n    \"\"\"The inline for pizza events in the Event admin.\"\"\"\n\n    model = FoodEvent\n    extra = 0\n    max_num = 1\n\n\nclass PromotionRequestInline(admin.StackedInline):\n    model = PromotionRequest\n    readonly_fields = (\n        \"assigned_to\",\n        \"status\",\n        \"drive_folder\",\n    )\n    extra = 0\n", "path": "website/events/admin/inlines.py"}]}