prompt: We are currently solving the following issue within our repository. Here is the issue text:
  --- BEGIN 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)
  
  
  --- END ISSUE ---
  
  Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
  --- BEGIN FILES ---
  Path: `akvo/rest/views/report.py`
  Content:
  ```
  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 FILES ---
  
  Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.
  
  Here is an example:
  
  ```diff
  diff --git a/examples/server_async.py b/examples/server_async.py
  --- a/examples/server_async.py
  +++ b/examples/server_async.py
  @@ -313,4 +313,4 @@
   
   
   if __name__ == "__main__":
  -    asyncio.run(run_async_server("."), debug=True)
  +    asyncio.run(run_async_server(), debug=True)
  diff --git a/examples/server_sync.py b/examples/server_sync.py
  --- a/examples/server_sync.py
  +++ b/examples/server_sync.py
  @@ -313,5 +313,5 @@
   
   
   if __name__ == "__main__":
  -    server = run_sync_server(".")
  +    server = run_sync_server()
       server.shutdown()
  
  ```
  
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"}], "after_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        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\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"}]}