prompt: You will be provided with a partial code base and an issue statement explaining a problem to resolve.
  <issue>
  Confirmation e-mails are not sent
  For some reason the confirmation e-mails are no longer being send.
  
  </issue>
  <code>
  [start of website/members/signals.py]
  1 import datetime
  2 from django.conf import settings
  3 from django.core.mail import EmailMultiAlternatives
  4 from django.db.models.signals import pre_save
  5 from django.dispatch import receiver
  6 from django.template import loader
  7 from django.utils import timezone
  8 from simple_email_confirmation import unconfirmed_email_created
  9 
  10 from members.models import Member
  11 
  12 
  13 @receiver(unconfirmed_email_created, dispatch_uid='send_email_confirmation')
  14 def send_confirmation_email(sender, email, user=None, **kwargs):
  15     if user is not None:
  16         context = {
  17             'email': email,
  18             'domain': settings.BASE_URL,
  19             'site_name': settings.WAGTAIL_SITE_NAME,
  20             'token': user.get_confirmation_key(email),
  21         }
  22 
  23         subject = loader.render_to_string(
  24             'members/email_change_subject.txt', context)
  25         # Email subject *must not* contain newlines
  26         subject = ''.join(subject.splitlines())
  27         body = loader.render_to_string('members/email_change_email.html',
  28                                        context)
  29 
  30         email_message = EmailMultiAlternatives(subject, body, None, [email])
  31         email_message.send()
  32 
  33 
  34 @receiver(pre_save, sender=Member, dispatch_uid='member_check_membership')
  35 def check_membership(sender, instance, **kwargs):
  36     if timezone.now() - instance.status_changed > datetime.timedelta(1):
  37         instance.update_status()
  38
  [end of website/members/signals.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/members/signals.py b/website/members/signals.py
  --- a/website/members/signals.py
  +++ b/website/members/signals.py
  @@ -12,6 +12,7 @@
   
   @receiver(unconfirmed_email_created, dispatch_uid='send_email_confirmation')
   def send_confirmation_email(sender, email, user=None, **kwargs):
  +    user = user or sender
       if user is not None:
           context = {
               'email': email,
  
verification_info: {"golden_diff": "diff --git a/website/members/signals.py b/website/members/signals.py\n--- a/website/members/signals.py\n+++ b/website/members/signals.py\n@@ -12,6 +12,7 @@\n \n @receiver(unconfirmed_email_created, dispatch_uid='send_email_confirmation')\n def send_confirmation_email(sender, email, user=None, **kwargs):\n+    user = user or sender\n     if user is not None:\n         context = {\n             'email': email,\n", "issue": "Confirmation e-mails are not sent\nFor some reason the confirmation e-mails are no longer being send.\n", "before_files": [{"content": "import datetime\nfrom django.conf import settings\nfrom django.core.mail import EmailMultiAlternatives\nfrom django.db.models.signals import pre_save\nfrom django.dispatch import receiver\nfrom django.template import loader\nfrom django.utils import timezone\nfrom simple_email_confirmation import unconfirmed_email_created\n\nfrom members.models import Member\n\n\n@receiver(unconfirmed_email_created, dispatch_uid='send_email_confirmation')\ndef send_confirmation_email(sender, email, user=None, **kwargs):\n    if user is not None:\n        context = {\n            'email': email,\n            'domain': settings.BASE_URL,\n            'site_name': settings.WAGTAIL_SITE_NAME,\n            'token': user.get_confirmation_key(email),\n        }\n\n        subject = loader.render_to_string(\n            'members/email_change_subject.txt', context)\n        # Email subject *must not* contain newlines\n        subject = ''.join(subject.splitlines())\n        body = loader.render_to_string('members/email_change_email.html',\n                                       context)\n\n        email_message = EmailMultiAlternatives(subject, body, None, [email])\n        email_message.send()\n\n\n@receiver(pre_save, sender=Member, dispatch_uid='member_check_membership')\ndef check_membership(sender, instance, **kwargs):\n    if timezone.now() - instance.status_changed > datetime.timedelta(1):\n        instance.update_status()\n", "path": "website/members/signals.py"}]}