prompt: You will be provided with a partial code base and an issue statement explaining a problem to resolve.
  <issue>
  project list does not show text if there are no matching projects
  It should show something like "No projects could be found". Note that the text should work for two cases: "there are no projects" and "there are no projects matching the filters".
  
  </issue>
  <code>
  [start of apps/contrib/templatetags/contrib_tags.py]
  1 from django import template
  2 from django.template.loader import render_to_string
  3 
  4 register = template.Library()
  5 
  6 
  7 @register.assignment_tag
  8 def include_template_string(template, **kwargs):
  9     rendered_template = render_to_string(template, kwargs)
  10     return str(rendered_template)
  11 
  12 
  13 @register.assignment_tag
  14 def combined_url_parameter(request_query_dict, **kwargs):
  15     combined_query_dict = request_query_dict.copy()
  16     for key in kwargs:
  17         combined_query_dict.setlist(key, [kwargs[key]])
  18     encoded_parameter = '?' + combined_query_dict.urlencode()
  19     return encoded_parameter
  20
  [end of apps/contrib/templatetags/contrib_tags.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/apps/contrib/templatetags/contrib_tags.py b/apps/contrib/templatetags/contrib_tags.py
  --- a/apps/contrib/templatetags/contrib_tags.py
  +++ b/apps/contrib/templatetags/contrib_tags.py
  @@ -17,3 +17,14 @@
           combined_query_dict.setlist(key, [kwargs[key]])
       encoded_parameter = '?' + combined_query_dict.urlencode()
       return encoded_parameter
  +
  +
  +@register.assignment_tag
  +def filter_has_perm(perm, user, objects):
  +    """Filter a list of objects based on user permissions."""
  +    if not hasattr(user, 'has_perm'):
  +        # If the swapped user model does not support permissions, all objects
  +        # will be returned. This is taken from rules.templatetags.has_perm.
  +        return objects
  +    else:
  +        return (obj for obj in objects if user.has_perm(perm, obj))
  
verification_info: {"golden_diff": "diff --git a/apps/contrib/templatetags/contrib_tags.py b/apps/contrib/templatetags/contrib_tags.py\n--- a/apps/contrib/templatetags/contrib_tags.py\n+++ b/apps/contrib/templatetags/contrib_tags.py\n@@ -17,3 +17,14 @@\n         combined_query_dict.setlist(key, [kwargs[key]])\n     encoded_parameter = '?' + combined_query_dict.urlencode()\n     return encoded_parameter\n+\n+\n+@register.assignment_tag\n+def filter_has_perm(perm, user, objects):\n+    \"\"\"Filter a list of objects based on user permissions.\"\"\"\n+    if not hasattr(user, 'has_perm'):\n+        # If the swapped user model does not support permissions, all objects\n+        # will be returned. This is taken from rules.templatetags.has_perm.\n+        return objects\n+    else:\n+        return (obj for obj in objects if user.has_perm(perm, obj))\n", "issue": "project list does not show text if there are no matching projects\nIt should show something like \"No projects could be found\". Note that the text should work for two cases: \"there are no projects\" and \"there are no projects matching the filters\".\n", "before_files": [{"content": "from django import template\nfrom django.template.loader import render_to_string\n\nregister = template.Library()\n\n\n@register.assignment_tag\ndef include_template_string(template, **kwargs):\n    rendered_template = render_to_string(template, kwargs)\n    return str(rendered_template)\n\n\n@register.assignment_tag\ndef combined_url_parameter(request_query_dict, **kwargs):\n    combined_query_dict = request_query_dict.copy()\n    for key in kwargs:\n        combined_query_dict.setlist(key, [kwargs[key]])\n    encoded_parameter = '?' + combined_query_dict.urlencode()\n    return encoded_parameter\n", "path": "apps/contrib/templatetags/contrib_tags.py"}]}