prompt: You will be provided with a partial code base and an issue statement explaining a problem to resolve.
  <issue>
  Deliver fallback of missing imprint translations in API
  ### Motivation
  <!-- A clear and concise description of what the motivation for the new feature is, and what problem it is solving. -->
  The imprint is mandatory for all regions and languages.
  
  ### Proposed Solution
  <!-- A clear and concise description of the feature you would like to add, and how it solves the motivating problem. -->
  Always return a result in the [imprint API](https://github.com/Integreat/integreat-cms/blob/develop/src/api/v3/imprint.py). If the translation is missing, deliver the imprint in the region's default language.
  
  ### Alternatives
  <!-- A clear and concise description of any alternative solutions or features you've considered, and why you're proposed solution is better. -->
  
  
  ### Additional Context
  <!-- Add any other information or screenshots about the feature request here. -->
  
  
  
  </issue>
  <code>
  [start of src/api/v3/imprint.py]
  1 """
  2 imprint API endpoint
  3 """
  4 from django.http import JsonResponse
  5 
  6 from backend.settings import BASE_URL
  7 from cms.models import Region
  8 
  9 from ..decorators import json_response
  10 
  11 
  12 def transform_imprint(imprint_translation):
  13     """
  14     Function to create a JSON from a single imprint_translation object.
  15 
  16     :param imprint_translation: single page translation object
  17     :type imprint_translation: ~cms.models.pages.page_translation.PageTranslation
  18 
  19     :return: return data necessary for API
  20     :rtype: dict
  21     """
  22     if imprint_translation.page.icon:
  23         thumbnail = BASE_URL + imprint_translation.page.icon.url
  24     else:
  25         thumbnail = None
  26     return {
  27         "id": imprint_translation.id,
  28         "url": imprint_translation.permalink,
  29         "title": imprint_translation.title,
  30         "modified_gmt": imprint_translation.last_updated,
  31         "excerpt": imprint_translation.text,
  32         "content": imprint_translation.text,
  33         "parent": None,
  34         "available_languages": imprint_translation.available_languages,
  35         "thumbnail": thumbnail,
  36         "hash": None,
  37     }
  38 
  39 
  40 @json_response
  41 # pylint: disable=unused-argument
  42 def imprint(request, region_slug, language_code):
  43     """
  44     Get imprint for language and return JSON object to client
  45 
  46     :param request: Django request
  47     :type request: ~django.http.HttpRequest
  48     :param region_slug: slug of a region
  49     :type region_slug: str
  50     :param language_code: language code
  51     :type language_code: str
  52 
  53     :return: JSON object according to APIv3 imprint endpoint definition
  54     :rtype: ~django.http.JsonResponse
  55     """
  56     region = Region.get_current_region(request)
  57     if hasattr(region, "imprint"):
  58         imprint_translation = region.imprint.get_public_translation(language_code)
  59         if imprint_translation:
  60             return JsonResponse(transform_imprint(imprint_translation))
  61     # If imprint does not exist, return an empty response. Turn off Safe-Mode to allow serializing arrays
  62     return JsonResponse([], safe=False)
  63
  [end of src/api/v3/imprint.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/src/api/v3/imprint.py b/src/api/v3/imprint.py
  --- a/src/api/v3/imprint.py
  +++ b/src/api/v3/imprint.py
  @@ -41,7 +41,9 @@
   # pylint: disable=unused-argument
   def imprint(request, region_slug, language_code):
       """
  -    Get imprint for language and return JSON object to client
  +    Get imprint for language and return JSON object to client. If no imprint translation
  +    is available in the selected language, try to return the translation in the region
  +    default language.
   
       :param request: Django request
       :type request: ~django.http.HttpRequest
  @@ -58,5 +60,11 @@
           imprint_translation = region.imprint.get_public_translation(language_code)
           if imprint_translation:
               return JsonResponse(transform_imprint(imprint_translation))
  +        if region.default_language:
  +            imprint_default_translation = region.imprint.get_public_translation(
  +                region.default_language.code
  +            )
  +            if imprint_default_translation:
  +                return JsonResponse(transform_imprint(imprint_default_translation))
       # If imprint does not exist, return an empty response. Turn off Safe-Mode to allow serializing arrays
       return JsonResponse([], safe=False)
  
verification_info: {"golden_diff": "diff --git a/src/api/v3/imprint.py b/src/api/v3/imprint.py\n--- a/src/api/v3/imprint.py\n+++ b/src/api/v3/imprint.py\n@@ -41,7 +41,9 @@\n # pylint: disable=unused-argument\n def imprint(request, region_slug, language_code):\n     \"\"\"\n-    Get imprint for language and return JSON object to client\n+    Get imprint for language and return JSON object to client. If no imprint translation\n+    is available in the selected language, try to return the translation in the region\n+    default language.\n \n     :param request: Django request\n     :type request: ~django.http.HttpRequest\n@@ -58,5 +60,11 @@\n         imprint_translation = region.imprint.get_public_translation(language_code)\n         if imprint_translation:\n             return JsonResponse(transform_imprint(imprint_translation))\n+        if region.default_language:\n+            imprint_default_translation = region.imprint.get_public_translation(\n+                region.default_language.code\n+            )\n+            if imprint_default_translation:\n+                return JsonResponse(transform_imprint(imprint_default_translation))\n     # If imprint does not exist, return an empty response. Turn off Safe-Mode to allow serializing arrays\n     return JsonResponse([], safe=False)\n", "issue": "Deliver fallback of missing imprint translations in API\n### Motivation\r\n<!-- A clear and concise description of what the motivation for the new feature is, and what problem it is solving. -->\r\nThe imprint is mandatory for all regions and languages.\r\n\r\n### Proposed Solution\r\n<!-- A clear and concise description of the feature you would like to add, and how it solves the motivating problem. -->\r\nAlways return a result in the [imprint API](https://github.com/Integreat/integreat-cms/blob/develop/src/api/v3/imprint.py). If the translation is missing, deliver the imprint in the region's default language.\r\n\r\n### Alternatives\r\n<!-- A clear and concise description of any alternative solutions or features you've considered, and why you're proposed solution is better. -->\r\n\r\n\r\n### Additional Context\r\n<!-- Add any other information or screenshots about the feature request here. -->\r\n\r\n\n", "before_files": [{"content": "\"\"\"\nimprint API endpoint\n\"\"\"\nfrom django.http import JsonResponse\n\nfrom backend.settings import BASE_URL\nfrom cms.models import Region\n\nfrom ..decorators import json_response\n\n\ndef transform_imprint(imprint_translation):\n    \"\"\"\n    Function to create a JSON from a single imprint_translation object.\n\n    :param imprint_translation: single page translation object\n    :type imprint_translation: ~cms.models.pages.page_translation.PageTranslation\n\n    :return: return data necessary for API\n    :rtype: dict\n    \"\"\"\n    if imprint_translation.page.icon:\n        thumbnail = BASE_URL + imprint_translation.page.icon.url\n    else:\n        thumbnail = None\n    return {\n        \"id\": imprint_translation.id,\n        \"url\": imprint_translation.permalink,\n        \"title\": imprint_translation.title,\n        \"modified_gmt\": imprint_translation.last_updated,\n        \"excerpt\": imprint_translation.text,\n        \"content\": imprint_translation.text,\n        \"parent\": None,\n        \"available_languages\": imprint_translation.available_languages,\n        \"thumbnail\": thumbnail,\n        \"hash\": None,\n    }\n\n\n@json_response\n# pylint: disable=unused-argument\ndef imprint(request, region_slug, language_code):\n    \"\"\"\n    Get imprint for language and return JSON object to client\n\n    :param request: Django request\n    :type request: ~django.http.HttpRequest\n    :param region_slug: slug of a region\n    :type region_slug: str\n    :param language_code: language code\n    :type language_code: str\n\n    :return: JSON object according to APIv3 imprint endpoint definition\n    :rtype: ~django.http.JsonResponse\n    \"\"\"\n    region = Region.get_current_region(request)\n    if hasattr(region, \"imprint\"):\n        imprint_translation = region.imprint.get_public_translation(language_code)\n        if imprint_translation:\n            return JsonResponse(transform_imprint(imprint_translation))\n    # If imprint does not exist, return an empty response. Turn off Safe-Mode to allow serializing arrays\n    return JsonResponse([], safe=False)\n", "path": "src/api/v3/imprint.py"}]}