prompt: You will be provided with a partial code base and an issue statement explaining a problem to resolve.
  <issue>
  Organisation report shown in project reports page
  The "Project overview" report is displayed on the project report page, which is an organisation report  and should not be displayed on the project report page.
  
  </issue>
  <code>
  [start of akvo/rest/views/report.py]
  1 # -*- coding: utf-8 -*-
  2 
  3 # Akvo RSR is covered by the GNU Affero General Public License.
  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 from django.db.models import Q
  8 from django.shortcuts import get_object_or_404
  9 from rest_framework import status
  10 from rest_framework.decorators import api_view
  11 from rest_framework.response import Response
  12 
  13 from akvo.rsr.models import Report, ReportFormat, Project
  14 from ..serializers import ReportSerializer, ReportFormatSerializer
  15 from ..viewsets import BaseRSRViewSet
  16 
  17 
  18 class ReportViewSet(BaseRSRViewSet):
  19     """Viewset providing Result data."""
  20 
  21     queryset = Report.objects.prefetch_related(
  22         'organisations',
  23         'formats',
  24     )
  25     serializer_class = ReportSerializer
  26 
  27     def get_queryset(self):
  28         """
  29         Allow custom filter for sync_owner, since this field has been replaced by the
  30         reporting org partnership.
  31         """
  32         reports = super(ReportViewSet, self).get_queryset()
  33         user = self.request.user
  34         is_admin = user.is_active and (user.is_superuser or user.is_admin)
  35         if not is_admin:
  36             # Show only those reports that the user is allowed to see
  37             approved_orgs = user.approved_organisations() if not user.is_anonymous() else []
  38             reports = reports.filter(
  39                 Q(organisations=None) | Q(organisations__in=approved_orgs)
  40             ).distinct()
  41         return reports
  42 
  43 
  44 @api_view(['GET'])
  45 def report_formats(request):
  46     """
  47     A view for displaying all report format information.
  48     """
  49     return Response({
  50         'count': ReportFormat.objects.all().count(),
  51         'results': [ReportFormatSerializer(f).data for f in ReportFormat.objects.all()],
  52     })
  53 
  54 
  55 @api_view(['GET'])
  56 def project_reports(request, project_pk):
  57     """A view for displaying project specific reports."""
  58 
  59     project = get_object_or_404(Project, pk=project_pk)
  60     reports = Report.objects.prefetch_related('formats', 'organisations')\
  61                             .filter(url__icontains='project')
  62 
  63     user = request.user
  64     if not user.has_perm('rsr.view_project', project):
  65         return Response('Request not allowed', status=status.HTTP_403_FORBIDDEN)
  66 
  67     is_admin = user.is_active and (user.is_superuser or user.is_admin)
  68 
  69     if not is_admin:
  70         partners_org = project.partner_organisation_pks()
  71         reports = reports.filter(
  72             Q(organisations=None) | Q(organisations__in=partners_org)
  73         )
  74 
  75     serializer = ReportSerializer(reports.distinct(), many=True)
  76     return Response(serializer.data)
  77
  [end of akvo/rest/views/report.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/rest/views/report.py b/akvo/rest/views/report.py
  --- a/akvo/rest/views/report.py
  +++ b/akvo/rest/views/report.py
  @@ -58,7 +58,7 @@
   
       project = get_object_or_404(Project, pk=project_pk)
       reports = Report.objects.prefetch_related('formats', 'organisations')\
  -                            .filter(url__icontains='project')
  +                            .filter(url__icontains='{project}')
   
       user = request.user
       if not user.has_perm('rsr.view_project', project):
  
verification_info: {"golden_diff": "diff --git a/akvo/rest/views/report.py b/akvo/rest/views/report.py\n--- a/akvo/rest/views/report.py\n+++ b/akvo/rest/views/report.py\n@@ -58,7 +58,7 @@\n \n     project = get_object_or_404(Project, pk=project_pk)\n     reports = Report.objects.prefetch_related('formats', 'organisations')\\\n-                            .filter(url__icontains='project')\n+                            .filter(url__icontains='{project}')\n \n     user = request.user\n     if not user.has_perm('rsr.view_project', project):\n", "issue": "Organisation report shown in project reports page\nThe \"Project overview\" report is displayed on the project report page, which is an organisation report  and should not be displayed on the project report page.\n", "before_files": [{"content": "# -*- coding: utf-8 -*-\n\n# Akvo RSR is covered by the GNU Affero General Public License.\n# See more details in the license.txt file located at the root folder of the Akvo RSR module.\n# For additional details on the GNU license please see < http://www.gnu.org/licenses/agpl.html >.\n\nfrom django.db.models import Q\nfrom django.shortcuts import get_object_or_404\nfrom rest_framework import status\nfrom rest_framework.decorators import api_view\nfrom rest_framework.response import Response\n\nfrom akvo.rsr.models import Report, ReportFormat, Project\nfrom ..serializers import ReportSerializer, ReportFormatSerializer\nfrom ..viewsets import BaseRSRViewSet\n\n\nclass ReportViewSet(BaseRSRViewSet):\n    \"\"\"Viewset providing Result data.\"\"\"\n\n    queryset = Report.objects.prefetch_related(\n        'organisations',\n        'formats',\n    )\n    serializer_class = ReportSerializer\n\n    def get_queryset(self):\n        \"\"\"\n        Allow custom filter for sync_owner, since this field has been replaced by the\n        reporting org partnership.\n        \"\"\"\n        reports = super(ReportViewSet, self).get_queryset()\n        user = self.request.user\n        is_admin = user.is_active and (user.is_superuser or user.is_admin)\n        if not is_admin:\n            # Show only those reports that the user is allowed to see\n            approved_orgs = user.approved_organisations() if not user.is_anonymous() else []\n            reports = reports.filter(\n                Q(organisations=None) | Q(organisations__in=approved_orgs)\n            ).distinct()\n        return reports\n\n\n@api_view(['GET'])\ndef report_formats(request):\n    \"\"\"\n    A view for displaying all report format information.\n    \"\"\"\n    return Response({\n        'count': ReportFormat.objects.all().count(),\n        'results': [ReportFormatSerializer(f).data for f in ReportFormat.objects.all()],\n    })\n\n\n@api_view(['GET'])\ndef project_reports(request, project_pk):\n    \"\"\"A view for displaying project specific reports.\"\"\"\n\n    project = get_object_or_404(Project, pk=project_pk)\n    reports = Report.objects.prefetch_related('formats', 'organisations')\\\n                            .filter(url__icontains='project')\n\n    user = request.user\n    if not user.has_perm('rsr.view_project', project):\n        return Response('Request not allowed', status=status.HTTP_403_FORBIDDEN)\n\n    is_admin = user.is_active and (user.is_superuser or user.is_admin)\n\n    if not is_admin:\n        partners_org = project.partner_organisation_pks()\n        reports = reports.filter(\n            Q(organisations=None) | Q(organisations__in=partners_org)\n        )\n\n    serializer = ReportSerializer(reports.distinct(), many=True)\n    return Response(serializer.data)\n", "path": "akvo/rest/views/report.py"}]}