prompt: You will be provided with a partial code base and an issue statement explaining a problem to resolve.
  <issue>
  Add a default Organsiation Logo image
  - [x] Finalise image decision
  - [x] Implement new image
  ## Test plan
  
  GIVEN the organisation directory page
  WHEN an organisation has no logo
  THEN the image as shown below should be displayed
  
  
  </issue>
  <code>
  [start of akvo/rsr/templatetags/rsr_utils.py]
  1 # -*- coding: utf-8 -*-
  2 """Akvo RSR is covered by the GNU Affero General Public License.
  3 
  4 See more details in the license.txt file located at the root folder of the Akvo RSR module.
  5 For additional details on the GNU license please see < http://www.gnu.org/licenses/agpl.html >.
  6 """
  7 
  8 from __future__ import absolute_import, print_function
  9 
  10 from django import template
  11 from django.contrib.auth import get_user_model
  12 from akvo.rsr.models import Keyword, PartnerSite, Project, ProjectUpdate, Organisation
  13 register = template.Library()
  14 
  15 
  16 @register.inclusion_tag('rsr_utils/img.html', takes_context=True)
  17 def img(context, obj, width, height, alt):
  18     """Standard way to show image."""
  19     geometry = '{}x{}'.format(width, height)
  20 
  21     # Based on type get image
  22     img = obj
  23     if isinstance(obj, Project):
  24         img = obj.current_image
  25     elif isinstance(obj, ProjectUpdate):
  26         img = obj.photo
  27     elif isinstance(obj, Organisation):
  28         img = obj.logo
  29     elif isinstance(obj, get_user_model()):
  30         img = obj.avatar
  31     elif isinstance(obj, PartnerSite):
  32         img = obj.logo
  33     elif isinstance(obj, Keyword):
  34         img = obj.logo
  35 
  36     height = '{}.px'.format(height)
  37 
  38     return {'alt': alt,
  39             'height': height,
  40             'img': img,
  41             'geometry': geometry,
  42             'width': width}
  43 
  44 
  45 @register.inclusion_tag('rsr_utils/vid_img.html', takes_context=True)
  46 def vid_img(context, obj, width, height, alt):
  47     """Standard way to show video thumbnail."""
  48     geometry = '{}x{}'.format(width, height)
  49 
  50     # Based on type get video
  51     vid = obj
  52     if isinstance(obj, ProjectUpdate):
  53         vid = obj.video
  54 
  55     height = '{}.px'.format(height)
  56 
  57     return {'alt': alt,
  58             'height': height,
  59             'vid': vid,
  60             'geometry': geometry,
  61             'width': width}
  62
  [end of akvo/rsr/templatetags/rsr_utils.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/akvo/rsr/templatetags/rsr_utils.py b/akvo/rsr/templatetags/rsr_utils.py
  --- a/akvo/rsr/templatetags/rsr_utils.py
  +++ b/akvo/rsr/templatetags/rsr_utils.py
  @@ -8,6 +8,7 @@
   from __future__ import absolute_import, print_function
   
   from django import template
  +from django.conf import settings
   from django.contrib.auth import get_user_model
   from akvo.rsr.models import Keyword, PartnerSite, Project, ProjectUpdate, Organisation
   register = template.Library()
  @@ -16,16 +17,22 @@
   @register.inclusion_tag('rsr_utils/img.html', takes_context=True)
   def img(context, obj, width, height, alt):
       """Standard way to show image."""
  -    geometry = '{}x{}'.format(width, height)
  +    img = ""
  +    geometry = "{}x{}".format(width, height)
  +    default_img = "//placehold.it/{}".format(geometry)
   
  -    # Based on type get image
  -    img = obj
       if isinstance(obj, Project):
           img = obj.current_image
       elif isinstance(obj, ProjectUpdate):
           img = obj.photo
       elif isinstance(obj, Organisation):
  -        img = obj.logo
  +        if obj.logo:
  +            img = obj.logo
  +        else:
  +            default_img = "//{}{}{}".format(
  +                context["request"].get_host(),
  +                getattr(settings, "STATIC_URL"),
  +                "images/default-org-logo.jpg")
       elif isinstance(obj, get_user_model()):
           img = obj.avatar
       elif isinstance(obj, PartnerSite):
  @@ -33,13 +40,10 @@
       elif isinstance(obj, Keyword):
           img = obj.logo
   
  -    height = '{}.px'.format(height)
  -
  -    return {'alt': alt,
  -            'height': height,
  -            'img': img,
  -            'geometry': geometry,
  -            'width': width}
  +    return {"default_img": default_img,
  +            "geometry": geometry,
  +            "img": img,
  +            "alt": alt}
   
   
   @register.inclusion_tag('rsr_utils/vid_img.html', takes_context=True)
  
verification_info: {"golden_diff": "diff --git a/akvo/rsr/templatetags/rsr_utils.py b/akvo/rsr/templatetags/rsr_utils.py\n--- a/akvo/rsr/templatetags/rsr_utils.py\n+++ b/akvo/rsr/templatetags/rsr_utils.py\n@@ -8,6 +8,7 @@\n from __future__ import absolute_import, print_function\n \n from django import template\n+from django.conf import settings\n from django.contrib.auth import get_user_model\n from akvo.rsr.models import Keyword, PartnerSite, Project, ProjectUpdate, Organisation\n register = template.Library()\n@@ -16,16 +17,22 @@\n @register.inclusion_tag('rsr_utils/img.html', takes_context=True)\n def img(context, obj, width, height, alt):\n     \"\"\"Standard way to show image.\"\"\"\n-    geometry = '{}x{}'.format(width, height)\n+    img = \"\"\n+    geometry = \"{}x{}\".format(width, height)\n+    default_img = \"//placehold.it/{}\".format(geometry)\n \n-    # Based on type get image\n-    img = obj\n     if isinstance(obj, Project):\n         img = obj.current_image\n     elif isinstance(obj, ProjectUpdate):\n         img = obj.photo\n     elif isinstance(obj, Organisation):\n-        img = obj.logo\n+        if obj.logo:\n+            img = obj.logo\n+        else:\n+            default_img = \"//{}{}{}\".format(\n+                context[\"request\"].get_host(),\n+                getattr(settings, \"STATIC_URL\"),\n+                \"images/default-org-logo.jpg\")\n     elif isinstance(obj, get_user_model()):\n         img = obj.avatar\n     elif isinstance(obj, PartnerSite):\n@@ -33,13 +40,10 @@\n     elif isinstance(obj, Keyword):\n         img = obj.logo\n \n-    height = '{}.px'.format(height)\n-\n-    return {'alt': alt,\n-            'height': height,\n-            'img': img,\n-            'geometry': geometry,\n-            'width': width}\n+    return {\"default_img\": default_img,\n+            \"geometry\": geometry,\n+            \"img\": img,\n+            \"alt\": alt}\n \n \n @register.inclusion_tag('rsr_utils/vid_img.html', takes_context=True)\n", "issue": "Add a default Organsiation Logo image\n- [x] Finalise image decision\n- [x] Implement new image\n## Test plan\n\nGIVEN the organisation directory page\nWHEN an organisation has no logo\nTHEN the image as shown below should be displayed\n\n", "before_files": [{"content": "# -*- coding: utf-8 -*-\n\"\"\"Akvo RSR is covered by the GNU Affero General Public License.\n\nSee more details in the license.txt file located at the root folder of the Akvo RSR module.\nFor additional details on the GNU license please see < http://www.gnu.org/licenses/agpl.html >.\n\"\"\"\n\nfrom __future__ import absolute_import, print_function\n\nfrom django import template\nfrom django.contrib.auth import get_user_model\nfrom akvo.rsr.models import Keyword, PartnerSite, Project, ProjectUpdate, Organisation\nregister = template.Library()\n\n\n@register.inclusion_tag('rsr_utils/img.html', takes_context=True)\ndef img(context, obj, width, height, alt):\n    \"\"\"Standard way to show image.\"\"\"\n    geometry = '{}x{}'.format(width, height)\n\n    # Based on type get image\n    img = obj\n    if isinstance(obj, Project):\n        img = obj.current_image\n    elif isinstance(obj, ProjectUpdate):\n        img = obj.photo\n    elif isinstance(obj, Organisation):\n        img = obj.logo\n    elif isinstance(obj, get_user_model()):\n        img = obj.avatar\n    elif isinstance(obj, PartnerSite):\n        img = obj.logo\n    elif isinstance(obj, Keyword):\n        img = obj.logo\n\n    height = '{}.px'.format(height)\n\n    return {'alt': alt,\n            'height': height,\n            'img': img,\n            'geometry': geometry,\n            'width': width}\n\n\n@register.inclusion_tag('rsr_utils/vid_img.html', takes_context=True)\ndef vid_img(context, obj, width, height, alt):\n    \"\"\"Standard way to show video thumbnail.\"\"\"\n    geometry = '{}x{}'.format(width, height)\n\n    # Based on type get video\n    vid = obj\n    if isinstance(obj, ProjectUpdate):\n        vid = obj.video\n\n    height = '{}.px'.format(height)\n\n    return {'alt': alt,\n            'height': height,\n            'vid': vid,\n            'geometry': geometry,\n            'width': width}\n", "path": "akvo/rsr/templatetags/rsr_utils.py"}]}