prompt: You will be provided with a partial code base and an issue statement explaining a problem to resolve.
  <issue>
  [partner landing page] unpublished and archived projects are shown
  On the partner landing page, we show unpublished and archived projects. Unpublished projects should never be shown and archived projects should be hidden per default.
  
  See: https://product-dev.liqd.net/teststadt/
  
  ![bildschirmfoto 2018-05-28 um 11 33 51](https://user-images.githubusercontent.com/15341015/40608238-2254983e-626b-11e8-8429-588c014f7a82.png)
  
  
  
  
  </issue>
  <code>
  [start of liqd_product/apps/partners/views.py]
  1 from django.contrib.messages.views import SuccessMessageMixin
  2 from django.utils.translation import ugettext_lazy as _
  3 from django.views import generic
  4 from django.views.generic import DetailView
  5 
  6 from adhocracy4.actions.models import Action
  7 from adhocracy4.projects.models import Project
  8 from adhocracy4.rules import mixins as rules_mixins
  9 from liqd_product.apps.partners.models import Partner
  10 
  11 from . import forms
  12 
  13 
  14 class PartnerView(DetailView):
  15     template_name = 'partner_landing_page.html'
  16     model = Partner
  17     slug_url_kwarg = 'partner_slug'
  18 
  19     def get_context_data(self, **kwargs):
  20         context = super().get_context_data(**kwargs)
  21 
  22         context['project_list'] = Project.objects\
  23             .filter(organisation__partner=self.object)
  24 
  25         context['action_list'] = Action.objects\
  26             .filter(project__organisation__partner=self.object)\
  27             .filter_public()\
  28             .exclude_updates()[:4]
  29 
  30         context['stats'] = {
  31             'users': 1204,
  32             'items': 3425,
  33             'comments': 23234,
  34             'ratings': 134234,
  35         }
  36 
  37         return context
  38 
  39 
  40 class InformationView(DetailView):
  41     template_name = 'partner_information.html'
  42     model = Partner
  43     slug_url_kwarg = 'partner_slug'
  44 
  45 
  46 class ImprintView(DetailView):
  47     template_name = 'partner_imprint.html'
  48     model = Partner
  49     slug_url_kwarg = 'partner_slug'
  50 
  51 
  52 class PartnerUpdateView(rules_mixins.PermissionRequiredMixin,
  53                         SuccessMessageMixin,
  54                         generic.UpdateView):
  55     model = Partner
  56     form_class = forms.PartnerForm
  57     slug_url_kwarg = 'partner_slug'
  58     template_name = 'partner_form.html'
  59     success_message = _('Municipality successfully updated.')
  60     permission_required = 'liqd_product_partners.change_partner'
  61     menu_item = 'partner'
  62 
  63     def get_success_url(self):
  64         return self.request.path
  65
  [end of liqd_product/apps/partners/views.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/liqd_product/apps/partners/views.py b/liqd_product/apps/partners/views.py
  --- a/liqd_product/apps/partners/views.py
  +++ b/liqd_product/apps/partners/views.py
  @@ -20,7 +20,9 @@
           context = super().get_context_data(**kwargs)
   
           context['project_list'] = Project.objects\
  -            .filter(organisation__partner=self.object)
  +            .filter(organisation__partner=self.object,
  +                    is_archived=False,
  +                    is_draft=False)
   
           context['action_list'] = Action.objects\
               .filter(project__organisation__partner=self.object)\
  
verification_info: {"golden_diff": "diff --git a/liqd_product/apps/partners/views.py b/liqd_product/apps/partners/views.py\n--- a/liqd_product/apps/partners/views.py\n+++ b/liqd_product/apps/partners/views.py\n@@ -20,7 +20,9 @@\n         context = super().get_context_data(**kwargs)\n \n         context['project_list'] = Project.objects\\\n-            .filter(organisation__partner=self.object)\n+            .filter(organisation__partner=self.object,\n+                    is_archived=False,\n+                    is_draft=False)\n \n         context['action_list'] = Action.objects\\\n             .filter(project__organisation__partner=self.object)\\\n", "issue": "[partner landing page] unpublished and archived projects are shown\nOn the partner landing page, we show unpublished and archived projects. Unpublished projects should never be shown and archived projects should be hidden per default.\r\n\r\nSee: https://product-dev.liqd.net/teststadt/\r\n\r\n![bildschirmfoto 2018-05-28 um 11 33 51](https://user-images.githubusercontent.com/15341015/40608238-2254983e-626b-11e8-8429-588c014f7a82.png)\r\n\r\n\r\n\n", "before_files": [{"content": "from django.contrib.messages.views import SuccessMessageMixin\nfrom django.utils.translation import ugettext_lazy as _\nfrom django.views import generic\nfrom django.views.generic import DetailView\n\nfrom adhocracy4.actions.models import Action\nfrom adhocracy4.projects.models import Project\nfrom adhocracy4.rules import mixins as rules_mixins\nfrom liqd_product.apps.partners.models import Partner\n\nfrom . import forms\n\n\nclass PartnerView(DetailView):\n    template_name = 'partner_landing_page.html'\n    model = Partner\n    slug_url_kwarg = 'partner_slug'\n\n    def get_context_data(self, **kwargs):\n        context = super().get_context_data(**kwargs)\n\n        context['project_list'] = Project.objects\\\n            .filter(organisation__partner=self.object)\n\n        context['action_list'] = Action.objects\\\n            .filter(project__organisation__partner=self.object)\\\n            .filter_public()\\\n            .exclude_updates()[:4]\n\n        context['stats'] = {\n            'users': 1204,\n            'items': 3425,\n            'comments': 23234,\n            'ratings': 134234,\n        }\n\n        return context\n\n\nclass InformationView(DetailView):\n    template_name = 'partner_information.html'\n    model = Partner\n    slug_url_kwarg = 'partner_slug'\n\n\nclass ImprintView(DetailView):\n    template_name = 'partner_imprint.html'\n    model = Partner\n    slug_url_kwarg = 'partner_slug'\n\n\nclass PartnerUpdateView(rules_mixins.PermissionRequiredMixin,\n                        SuccessMessageMixin,\n                        generic.UpdateView):\n    model = Partner\n    form_class = forms.PartnerForm\n    slug_url_kwarg = 'partner_slug'\n    template_name = 'partner_form.html'\n    success_message = _('Municipality successfully updated.')\n    permission_required = 'liqd_product_partners.change_partner'\n    menu_item = 'partner'\n\n    def get_success_url(self):\n        return self.request.path\n", "path": "liqd_product/apps/partners/views.py"}]}