prompt: You will be provided with a partial code base and an issue statement explaining a problem to resolve.
  <issue>
  Invited from queue email missing some stuff
  ### Describe the bug
  ![image](https://user-images.githubusercontent.com/41264528/217180789-a1478ad4-56b2-43af-b6f0-52ee272e2bc6.jpeg)
  
  
  ### How to reproduce
  Steps to reproduce the behaviour:
  1. Be in queue
  2. Get invited (by people deregistering)
  
  </issue>
  <code>
  [start of website/events/emails.py]
  1 """The emails defined by the events package."""
  2 from django.conf import settings
  3 from django.core.mail import EmailMessage
  4 from django.template.loader import get_template
  5 from django.utils.translation import gettext_lazy as _
  6 
  7 
  8 def notify_first_waiting(event):
  9     """Send an email to the first person on the waiting list when someone cancels their registration.
  10 
  11     :param event: the event
  12     """
  13     if (
  14         event.max_participants is not None
  15         and event.eventregistration_set.filter(date_cancelled=None).count()
  16         > event.max_participants
  17     ):
  18         # Prepare email to send to the first person on the waiting list
  19         first_waiting = event.eventregistration_set.filter(
  20             date_cancelled=None
  21         ).order_by("date")[event.max_participants]
  22 
  23         text_template = get_template("events/member_email.txt")
  24 
  25         subject = _("[THALIA] Notification about your registration for '{}'").format(
  26             event.title
  27         )
  28         text_message = text_template.render(
  29             {
  30                 "event": event,
  31                 "registration": first_waiting,
  32                 "name": first_waiting.name or first_waiting.member.first_name,
  33                 "base_url": settings.BASE_URL,
  34             }
  35         )
  36 
  37         EmailMessage(subject, text_message, to=[first_waiting.email]).send()
  38 
  39 
  40 def notify_organiser(event, registration):
  41     """Send an email to the organiser of the event if someone cancels their registration.
  42 
  43     :param event: the event
  44     :param registration: the registration that was cancelled
  45     """
  46     if not event.organisers.exists():
  47         return
  48 
  49     text_template = get_template("events/organiser_email.txt")
  50     subject = f"Registration for {event.title} cancelled by member"
  51     text_message = text_template.render({"event": event, "registration": registration})
  52 
  53     EmailMessage(
  54         subject,
  55         text_message,
  56         to=[
  57             organiser.contact_mailinglist.name + "@" + settings.SITE_DOMAIN
  58             for organiser in event.organisers.all()
  59         ],
  60     ).send()
  61 
  62 
  63 def notify_waiting(event, registration):
  64     text_template = get_template("events/more_places_email.txt")
  65     subject = _("[THALIA] Notification about your registration for '{}'").format(
  66         event.title
  67     )
  68     text_message = text_template.render(
  69         {
  70             "event": event,
  71             "registration": registration,
  72             "name": registration.name or registration.member.first_name,
  73             "base_url": settings.BASE_URL,
  74         }
  75     )
  76     EmailMessage(subject, text_message, to=[registration.email]).send()
  77
  [end of website/events/emails.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/emails.py b/website/events/emails.py
  --- a/website/events/emails.py
  +++ b/website/events/emails.py
  @@ -25,12 +25,19 @@
           subject = _("[THALIA] Notification about your registration for '{}'").format(
               event.title
           )
  +
  +        organiser_emails = [
  +            organiser.contact_address
  +            for organiser in event.organisers.all()
  +            if organiser.contact_address is not None
  +        ]
           text_message = text_template.render(
               {
                   "event": event,
                   "registration": first_waiting,
                   "name": first_waiting.name or first_waiting.member.first_name,
                   "base_url": settings.BASE_URL,
  +                "organisers": organiser_emails,
               }
           )
  
verification_info: {"golden_diff": "diff --git a/website/events/emails.py b/website/events/emails.py\n--- a/website/events/emails.py\n+++ b/website/events/emails.py\n@@ -25,12 +25,19 @@\n         subject = _(\"[THALIA] Notification about your registration for '{}'\").format(\n             event.title\n         )\n+\n+        organiser_emails = [\n+            organiser.contact_address\n+            for organiser in event.organisers.all()\n+            if organiser.contact_address is not None\n+        ]\n         text_message = text_template.render(\n             {\n                 \"event\": event,\n                 \"registration\": first_waiting,\n                 \"name\": first_waiting.name or first_waiting.member.first_name,\n                 \"base_url\": settings.BASE_URL,\n+                \"organisers\": organiser_emails,\n             }\n         )\n", "issue": "Invited from queue email missing some stuff\n### Describe the bug\n![image](https://user-images.githubusercontent.com/41264528/217180789-a1478ad4-56b2-43af-b6f0-52ee272e2bc6.jpeg)\n\n\n### How to reproduce\nSteps to reproduce the behaviour:\n1. Be in queue\n2. Get invited (by people deregistering)\n", "before_files": [{"content": "\"\"\"The emails defined by the events package.\"\"\"\nfrom django.conf import settings\nfrom django.core.mail import EmailMessage\nfrom django.template.loader import get_template\nfrom django.utils.translation import gettext_lazy as _\n\n\ndef notify_first_waiting(event):\n    \"\"\"Send an email to the first person on the waiting list when someone cancels their registration.\n\n    :param event: the event\n    \"\"\"\n    if (\n        event.max_participants is not None\n        and event.eventregistration_set.filter(date_cancelled=None).count()\n        > event.max_participants\n    ):\n        # Prepare email to send to the first person on the waiting list\n        first_waiting = event.eventregistration_set.filter(\n            date_cancelled=None\n        ).order_by(\"date\")[event.max_participants]\n\n        text_template = get_template(\"events/member_email.txt\")\n\n        subject = _(\"[THALIA] Notification about your registration for '{}'\").format(\n            event.title\n        )\n        text_message = text_template.render(\n            {\n                \"event\": event,\n                \"registration\": first_waiting,\n                \"name\": first_waiting.name or first_waiting.member.first_name,\n                \"base_url\": settings.BASE_URL,\n            }\n        )\n\n        EmailMessage(subject, text_message, to=[first_waiting.email]).send()\n\n\ndef notify_organiser(event, registration):\n    \"\"\"Send an email to the organiser of the event if someone cancels their registration.\n\n    :param event: the event\n    :param registration: the registration that was cancelled\n    \"\"\"\n    if not event.organisers.exists():\n        return\n\n    text_template = get_template(\"events/organiser_email.txt\")\n    subject = f\"Registration for {event.title} cancelled by member\"\n    text_message = text_template.render({\"event\": event, \"registration\": registration})\n\n    EmailMessage(\n        subject,\n        text_message,\n        to=[\n            organiser.contact_mailinglist.name + \"@\" + settings.SITE_DOMAIN\n            for organiser in event.organisers.all()\n        ],\n    ).send()\n\n\ndef notify_waiting(event, registration):\n    text_template = get_template(\"events/more_places_email.txt\")\n    subject = _(\"[THALIA] Notification about your registration for '{}'\").format(\n        event.title\n    )\n    text_message = text_template.render(\n        {\n            \"event\": event,\n            \"registration\": registration,\n            \"name\": registration.name or registration.member.first_name,\n            \"base_url\": settings.BASE_URL,\n        }\n    )\n    EmailMessage(subject, text_message, to=[registration.email]).send()\n", "path": "website/events/emails.py"}]}