prompt: You will be provided with a partial code base and an issue statement explaining a problem to resolve.
  <issue>
  Projectcontainer active projects count broken
  https://mein.berlin.de/projects/stadtforum-berlin-wohnen/
  
  shows `7 of 4` active projects.
  
  </issue>
  <code>
  [start of meinberlin/apps/projectcontainers/models.py]
  1 from django.db import models
  2 from django.utils import timezone
  3 from django.utils.translation import ugettext_lazy as _
  4 
  5 from adhocracy4.projects import models as project_models
  6 
  7 
  8 class ProjectContainer(project_models.Project):
  9     projects = models.ManyToManyField(
  10         project_models.Project,
  11         related_name='containers',
  12         verbose_name=_('Projects')
  13     )
  14 
  15     @property
  16     def not_archived_projects(self):
  17         return self.projects.filter(is_archived=False)
  18 
  19     @property
  20     def active_projects(self):
  21         now = timezone.now()
  22         return self.projects.filter(
  23             module__phase__start_date__lte=now,
  24             module__phase__end_date__gt=now)
  25 
  26     @property
  27     def phases(self):
  28         from adhocracy4.phases import models as phase_models
  29         return phase_models.Phase.objects\
  30             .filter(module__project__containers__id=self.id)
  31
  [end of meinberlin/apps/projectcontainers/models.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/meinberlin/apps/projectcontainers/models.py b/meinberlin/apps/projectcontainers/models.py
  --- a/meinberlin/apps/projectcontainers/models.py
  +++ b/meinberlin/apps/projectcontainers/models.py
  @@ -21,7 +21,7 @@
           now = timezone.now()
           return self.projects.filter(
               module__phase__start_date__lte=now,
  -            module__phase__end_date__gt=now)
  +            module__phase__end_date__gt=now).distinct()
   
       @property
       def phases(self):
  
verification_info: {"golden_diff": "diff --git a/meinberlin/apps/projectcontainers/models.py b/meinberlin/apps/projectcontainers/models.py\n--- a/meinberlin/apps/projectcontainers/models.py\n+++ b/meinberlin/apps/projectcontainers/models.py\n@@ -21,7 +21,7 @@\n         now = timezone.now()\n         return self.projects.filter(\n             module__phase__start_date__lte=now,\n-            module__phase__end_date__gt=now)\n+            module__phase__end_date__gt=now).distinct()\n \n     @property\n     def phases(self):\n", "issue": "Projectcontainer active projects count broken\nhttps://mein.berlin.de/projects/stadtforum-berlin-wohnen/\r\n\r\nshows `7 of 4` active projects.\n", "before_files": [{"content": "from django.db import models\nfrom django.utils import timezone\nfrom django.utils.translation import ugettext_lazy as _\n\nfrom adhocracy4.projects import models as project_models\n\n\nclass ProjectContainer(project_models.Project):\n    projects = models.ManyToManyField(\n        project_models.Project,\n        related_name='containers',\n        verbose_name=_('Projects')\n    )\n\n    @property\n    def not_archived_projects(self):\n        return self.projects.filter(is_archived=False)\n\n    @property\n    def active_projects(self):\n        now = timezone.now()\n        return self.projects.filter(\n            module__phase__start_date__lte=now,\n            module__phase__end_date__gt=now)\n\n    @property\n    def phases(self):\n        from adhocracy4.phases import models as phase_models\n        return phase_models.Phase.objects\\\n            .filter(module__project__containers__id=self.id)\n", "path": "meinberlin/apps/projectcontainers/models.py"}]}