prompt: You will be provided with a partial code base and an issue statement explaining a problem to resolve.
  <issue>
  Select2 on disposition view shows error alert
  Closing the select2 field in the disposition view without selecting an entry (e.g. by typing something into the field an then clicking somewhere outside the field) also triggers the form submission. This fails because no valid user has been selected and consequently shows an ugly alert to the user.
  
  </issue>
  <code>
  [start of ephios/core/context.py]
  1 import importlib
  2 
  3 from django.conf import settings
  4 from django.templatetags.static import static
  5 from django.utils.translation import get_language
  6 
  7 from ephios.core.models import AbstractParticipation
  8 from ephios.core.signals import footer_link
  9 
  10 # suggested in https://github.com/python-poetry/poetry/issues/273
  11 EPHIOS_VERSION = "v" + importlib.metadata.version("ephios")
  12 
  13 
  14 def ephios_base_context(request):
  15     footer = {}
  16     for _, result in footer_link.send(None, request=request):
  17         for label, url in result.items():
  18             footer[label] = url
  19 
  20     datatables_translation_url = None
  21     if get_language() == "de-de":
  22         datatables_translation_url = static("datatables/german.json")
  23 
  24     return {
  25         "ParticipationStates": AbstractParticipation.States,
  26         "footer": footer,
  27         "datatables_translation_url": datatables_translation_url,
  28         "ephios_version": EPHIOS_VERSION,
  29         "SITE_URL": settings.SITE_URL,
  30         "PWA_APP_ICONS": settings.PWA_APP_ICONS,
  31     }
  32
  [end of ephios/core/context.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/core/context.py b/ephios/core/context.py
  --- a/ephios/core/context.py
  +++ b/ephios/core/context.py
  @@ -1,7 +1,6 @@
   import importlib
   
   from django.conf import settings
  -from django.templatetags.static import static
   from django.utils.translation import get_language
   
   from ephios.core.models import AbstractParticipation
  @@ -17,14 +16,10 @@
           for label, url in result.items():
               footer[label] = url
   
  -    datatables_translation_url = None
  -    if get_language() == "de-de":
  -        datatables_translation_url = static("datatables/german.json")
  -
       return {
           "ParticipationStates": AbstractParticipation.States,
           "footer": footer,
  -        "datatables_translation_url": datatables_translation_url,
  +        "LANGUAGE_CODE": get_language(),
           "ephios_version": EPHIOS_VERSION,
           "SITE_URL": settings.SITE_URL,
           "PWA_APP_ICONS": settings.PWA_APP_ICONS,
  
verification_info: {"golden_diff": "diff --git a/ephios/core/context.py b/ephios/core/context.py\n--- a/ephios/core/context.py\n+++ b/ephios/core/context.py\n@@ -1,7 +1,6 @@\n import importlib\n \n from django.conf import settings\n-from django.templatetags.static import static\n from django.utils.translation import get_language\n \n from ephios.core.models import AbstractParticipation\n@@ -17,14 +16,10 @@\n         for label, url in result.items():\n             footer[label] = url\n \n-    datatables_translation_url = None\n-    if get_language() == \"de-de\":\n-        datatables_translation_url = static(\"datatables/german.json\")\n-\n     return {\n         \"ParticipationStates\": AbstractParticipation.States,\n         \"footer\": footer,\n-        \"datatables_translation_url\": datatables_translation_url,\n+        \"LANGUAGE_CODE\": get_language(),\n         \"ephios_version\": EPHIOS_VERSION,\n         \"SITE_URL\": settings.SITE_URL,\n         \"PWA_APP_ICONS\": settings.PWA_APP_ICONS,\n", "issue": "Select2 on disposition view shows error alert\nClosing the select2 field in the disposition view without selecting an entry (e.g. by typing something into the field an then clicking somewhere outside the field) also triggers the form submission. This fails because no valid user has been selected and consequently shows an ugly alert to the user.\n", "before_files": [{"content": "import importlib\n\nfrom django.conf import settings\nfrom django.templatetags.static import static\nfrom django.utils.translation import get_language\n\nfrom ephios.core.models import AbstractParticipation\nfrom ephios.core.signals import footer_link\n\n# suggested in https://github.com/python-poetry/poetry/issues/273\nEPHIOS_VERSION = \"v\" + importlib.metadata.version(\"ephios\")\n\n\ndef ephios_base_context(request):\n    footer = {}\n    for _, result in footer_link.send(None, request=request):\n        for label, url in result.items():\n            footer[label] = url\n\n    datatables_translation_url = None\n    if get_language() == \"de-de\":\n        datatables_translation_url = static(\"datatables/german.json\")\n\n    return {\n        \"ParticipationStates\": AbstractParticipation.States,\n        \"footer\": footer,\n        \"datatables_translation_url\": datatables_translation_url,\n        \"ephios_version\": EPHIOS_VERSION,\n        \"SITE_URL\": settings.SITE_URL,\n        \"PWA_APP_ICONS\": settings.PWA_APP_ICONS,\n    }\n", "path": "ephios/core/context.py"}]}