prompt: You will be provided with a partial code base and an issue statement explaining a problem to resolve.
  <issue>
  List of own upcoming shifts
  As a user, I want to see a list of shifts that I have been confirmed for on the main page.
  
  </issue>
  <code>
  [start of ephios/event_management/templatetags/event_extras.py]
  1 from django import template
  2 from django.utils.safestring import mark_safe
  3 
  4 from ephios.event_management.models import AbstractParticipation
  5 
  6 register = template.Library()
  7 
  8 
  9 @register.filter(name="shift_status")
  10 def shift_status(shift, user):
  11     participation = user.as_participant().participation_for(shift)
  12     if participation is not None:
  13         color = {
  14             AbstractParticipation.States.USER_DECLINED: "text-danger",
  15             AbstractParticipation.States.RESPONSIBLE_REJECTED: "text-danger",
  16             AbstractParticipation.States.REQUESTED: "text-warning",
  17             AbstractParticipation.States.CONFIRMED: "text-success",
  18         }[participation.state]
  19         return mark_safe(f'<span class="{color}">{participation.get_state_display()}</span><br>')
  20     return ""
  21 
  22 
  23 @register.filter(name="can_sign_up")
  24 def can_sign_up(shift, user):
  25     return shift.signup_method.can_sign_up(user.as_participant())
  26 
  27 
  28 @register.filter(name="render_shift_state")
  29 def render_shift_state(shift, request):
  30     return shift.signup_method.render_shift_state(request)
  31 
  32 
  33 @register.filter(name="signup_errors")
  34 def signup_errors(shift, user):
  35     return shift.signup_method.get_signup_errors(user.as_participant())
  36 
  37 
  38 @register.filter(name="can_decline")
  39 def can_decline(shift, user):
  40     return shift.signup_method.can_decline(user.as_participant())
  41 
  42 
  43 @register.filter(name="decline_errors")
  44 def decline_errors(shift, user):
  45     return shift.signup_method.get_decline_errors(user.as_participant())
  46
  [end of ephios/event_management/templatetags/event_extras.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/ephios/event_management/templatetags/event_extras.py b/ephios/event_management/templatetags/event_extras.py
  --- a/ephios/event_management/templatetags/event_extras.py
  +++ b/ephios/event_management/templatetags/event_extras.py
  @@ -43,3 +43,10 @@
   @register.filter(name="decline_errors")
   def decline_errors(shift, user):
       return shift.signup_method.get_decline_errors(user.as_participant())
  +
  +
  +@register.filter(name="confirmed_shifts")
  +def confirmed_shifts(user):
  +    return user.get_shifts(
  +        with_participation_state_in=[AbstractParticipation.States.CONFIRMED]
  +    ).order_by("start_time")
  
verification_info: {"golden_diff": "diff --git a/ephios/event_management/templatetags/event_extras.py b/ephios/event_management/templatetags/event_extras.py\n--- a/ephios/event_management/templatetags/event_extras.py\n+++ b/ephios/event_management/templatetags/event_extras.py\n@@ -43,3 +43,10 @@\n @register.filter(name=\"decline_errors\")\n def decline_errors(shift, user):\n     return shift.signup_method.get_decline_errors(user.as_participant())\n+\n+\n+@register.filter(name=\"confirmed_shifts\")\n+def confirmed_shifts(user):\n+    return user.get_shifts(\n+        with_participation_state_in=[AbstractParticipation.States.CONFIRMED]\n+    ).order_by(\"start_time\")\n", "issue": "List of own upcoming shifts\nAs a user, I want to see a list of shifts that I have been confirmed for on the main page.\n", "before_files": [{"content": "from django import template\nfrom django.utils.safestring import mark_safe\n\nfrom ephios.event_management.models import AbstractParticipation\n\nregister = template.Library()\n\n\n@register.filter(name=\"shift_status\")\ndef shift_status(shift, user):\n    participation = user.as_participant().participation_for(shift)\n    if participation is not None:\n        color = {\n            AbstractParticipation.States.USER_DECLINED: \"text-danger\",\n            AbstractParticipation.States.RESPONSIBLE_REJECTED: \"text-danger\",\n            AbstractParticipation.States.REQUESTED: \"text-warning\",\n            AbstractParticipation.States.CONFIRMED: \"text-success\",\n        }[participation.state]\n        return mark_safe(f'<span class=\"{color}\">{participation.get_state_display()}</span><br>')\n    return \"\"\n\n\n@register.filter(name=\"can_sign_up\")\ndef can_sign_up(shift, user):\n    return shift.signup_method.can_sign_up(user.as_participant())\n\n\n@register.filter(name=\"render_shift_state\")\ndef render_shift_state(shift, request):\n    return shift.signup_method.render_shift_state(request)\n\n\n@register.filter(name=\"signup_errors\")\ndef signup_errors(shift, user):\n    return shift.signup_method.get_signup_errors(user.as_participant())\n\n\n@register.filter(name=\"can_decline\")\ndef can_decline(shift, user):\n    return shift.signup_method.can_decline(user.as_participant())\n\n\n@register.filter(name=\"decline_errors\")\ndef decline_errors(shift, user):\n    return shift.signup_method.get_decline_errors(user.as_participant())\n", "path": "ephios/event_management/templatetags/event_extras.py"}]}