prompt: You will be provided with a partial code base and an issue statement explaining a problem to resolve.
  <issue>
  Custom reports removed from 'Reports'  general view
  Remove custom reports from 'Reports' general view, i.e. Plan Finland or EUTF reports are not visible for other partners. 
  
  ![custom reports included](https://user-images.githubusercontent.com/26227538/33214973-4bf3ce5e-d12e-11e7-8a73-d5f3221f3b30.png)
  
  
  </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 rest_framework.decorators import api_view
  9 from rest_framework.response import Response
  10 
  11 from akvo.rsr.models import Report, ReportFormat
  12 from ..serializers import ReportSerializer, ReportFormatSerializer
  13 
  14 
  15 @api_view(['GET'])
  16 def reports(request):
  17     """
  18     A view for displaying all report information, sorted by title.
  19     """
  20 
  21     user = request.user
  22     is_admin = user.is_active and (user.is_superuser or user.is_admin)
  23     reports = Report.objects.all()
  24     if not is_admin:
  25         # Show only those reports that the user is allowed to see
  26         reports = reports.filter(
  27             Q(organisations=None) | Q(organisations__in=user.approved_organisations())
  28         ).distinct()
  29 
  30     # FIXME: Use a viewset instead?
  31     return Response({
  32         'count': reports.count(),
  33         'results': [ReportSerializer(r).data for r in reports.order_by('title')],
  34     })
  35 
  36 
  37 @api_view(['GET'])
  38 def report_formats(request):
  39     """
  40     A view for displaying all report format information.
  41     """
  42     return Response({
  43         'count': ReportFormat.objects.all().count(),
  44         'results': [ReportFormatSerializer(f).data for f in ReportFormat.objects.all()],
  45     })
  46
  [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
  @@ -23,8 +23,9 @@
       reports = Report.objects.all()
       if not is_admin:
           # Show only those reports that the user is allowed to see
  +        approved_orgs = user.approved_organisations() if not user.is_anonymous() else []
           reports = reports.filter(
  -            Q(organisations=None) | Q(organisations__in=user.approved_organisations())
  +            Q(organisations=None) | Q(organisations__in=approved_orgs)
           ).distinct()
   
       # FIXME: Use a viewset instead?
  
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@@ -23,8 +23,9 @@\n     reports = Report.objects.all()\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=user.approved_organisations())\n+            Q(organisations=None) | Q(organisations__in=approved_orgs)\n         ).distinct()\n \n     # FIXME: Use a viewset instead?\n", "issue": "Custom reports removed from 'Reports'  general view\nRemove custom reports from 'Reports' general view, i.e. Plan Finland or EUTF reports are not visible for other partners. \r\n\r\n![custom reports included](https://user-images.githubusercontent.com/26227538/33214973-4bf3ce5e-d12e-11e7-8a73-d5f3221f3b30.png)\r\n\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 rest_framework.decorators import api_view\nfrom rest_framework.response import Response\n\nfrom akvo.rsr.models import Report, ReportFormat\nfrom ..serializers import ReportSerializer, ReportFormatSerializer\n\n\n@api_view(['GET'])\ndef reports(request):\n    \"\"\"\n    A view for displaying all report information, sorted by title.\n    \"\"\"\n\n    user = request.user\n    is_admin = user.is_active and (user.is_superuser or user.is_admin)\n    reports = Report.objects.all()\n    if not is_admin:\n        # Show only those reports that the user is allowed to see\n        reports = reports.filter(\n            Q(organisations=None) | Q(organisations__in=user.approved_organisations())\n        ).distinct()\n\n    # FIXME: Use a viewset instead?\n    return Response({\n        'count': reports.count(),\n        'results': [ReportSerializer(r).data for r in reports.order_by('title')],\n    })\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", "path": "akvo/rest/views/report.py"}]}