prompt: We are currently solving the following issue within our repository. Here is the issue text:
  --- BEGIN ISSUE ---
  Show results framework for private projects
  ## Test plan
  
  GIVEN the 'My results' tab in MyRSR
  WHEN searching for a private project
  THEN the project should appear in the list
  
  WHEN the private project is opened in 'My results'
  THEN the user should have full access to the results framework, just like a regular public project
  ## Issue description
  
  Currently, we have disabled the results framework in MyRSR for private projects. However, it should be possible to enter results data for private projects as well.
  
  
  --- 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/typeahead.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
  5 Akvo RSR module. For additional details on the GNU license please
  6 see < http://www.gnu.org/licenses/agpl.html >.
  7 """
  8 
  9 from akvo.rest.serializers import (TypeaheadCountrySerializer,
  10                                    TypeaheadOrganisationSerializer,
  11                                    TypeaheadProjectSerializer,
  12                                    TypeaheadProjectUpdateSerializer)
  13 from akvo.rsr.models import Country, Organisation, Project, ProjectUpdate
  14 
  15 from rest_framework.decorators import api_view
  16 from rest_framework.response import Response
  17 
  18 
  19 def rejig(queryset, serializer):
  20     """Rearrange & add queryset count to the response data."""
  21     return {
  22         'count': queryset.count(),
  23         'results': serializer.data
  24     }
  25 
  26 
  27 @api_view(['GET'])
  28 def typeahead_country(request):
  29     countries = Country.objects.all()
  30     return Response(
  31         rejig(countries, TypeaheadCountrySerializer(countries, many=True))
  32     )
  33 
  34 
  35 @api_view(['GET'])
  36 def typeahead_organisation(request):
  37     organisations = Organisation.objects.all()
  38     return Response(
  39         rejig(organisations, TypeaheadOrganisationSerializer(organisations,
  40                                                              many=True))
  41     )
  42 
  43 
  44 @api_view(['GET'])
  45 def typeahead_user_organisations(request):
  46     user = request.user
  47     is_admin = user.is_active and (user.is_superuser or user.is_admin)
  48     organisations = user.approved_organisations() if not is_admin else Organisation.objects.all()
  49     return Response(
  50         rejig(organisations, TypeaheadOrganisationSerializer(organisations,
  51                                                              many=True))
  52     )
  53 
  54 
  55 @api_view(['GET'])
  56 def typeahead_project(request):
  57     projects = Project.objects.all().exclude(title='')
  58     return Response(
  59         rejig(projects, TypeaheadProjectSerializer(projects, many=True))
  60     )
  61 
  62 
  63 @api_view(['GET'])
  64 def typeahead_user_projects(request):
  65     user = request.user
  66     is_admin = user.is_active and (user.is_superuser or user.is_admin)
  67     if is_admin:
  68         projects = Project.objects.all()
  69     else:
  70         projects = user.approved_organisations().all_projects()
  71     projects = projects.exclude(title='')
  72     return Response(
  73         rejig(projects, TypeaheadProjectSerializer(projects, many=True))
  74     )
  75 
  76 
  77 @api_view(['GET'])
  78 def typeahead_impact_projects(request):
  79     user = request.user
  80     projects = Project.objects.all() if user.is_admin or user.is_superuser else user.my_projects()
  81     projects = projects.published().filter(is_impact_project=True, is_public=True).order_by('title')
  82 
  83     return Response(
  84         rejig(projects, TypeaheadProjectSerializer(projects, many=True))
  85     )
  86 
  87 
  88 @api_view(['GET'])
  89 def typeahead_projectupdate(request):
  90     updates = ProjectUpdate.objects.all()
  91     return Response(
  92         rejig(updates, TypeaheadProjectUpdateSerializer(updates, many=True))
  93     )
  94
  ```
  --- 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/typeahead.py b/akvo/rest/views/typeahead.py
  --- a/akvo/rest/views/typeahead.py
  +++ b/akvo/rest/views/typeahead.py
  @@ -78,7 +78,7 @@
   def typeahead_impact_projects(request):
       user = request.user
       projects = Project.objects.all() if user.is_admin or user.is_superuser else user.my_projects()
  -    projects = projects.published().filter(is_impact_project=True, is_public=True).order_by('title')
  +    projects = projects.published().filter(is_impact_project=True).order_by('title')
   
       return Response(
           rejig(projects, TypeaheadProjectSerializer(projects, many=True))
  
verification_info: {"golden_diff": "diff --git a/akvo/rest/views/typeahead.py b/akvo/rest/views/typeahead.py\n--- a/akvo/rest/views/typeahead.py\n+++ b/akvo/rest/views/typeahead.py\n@@ -78,7 +78,7 @@\n def typeahead_impact_projects(request):\n     user = request.user\n     projects = Project.objects.all() if user.is_admin or user.is_superuser else user.my_projects()\n-    projects = projects.published().filter(is_impact_project=True, is_public=True).order_by('title')\n+    projects = projects.published().filter(is_impact_project=True).order_by('title')\n \n     return Response(\n         rejig(projects, TypeaheadProjectSerializer(projects, many=True))\n", "issue": "Show results framework for private projects\n## Test plan\n\nGIVEN the 'My results' tab in MyRSR\nWHEN searching for a private project\nTHEN the project should appear in the list\n\nWHEN the private project is opened in 'My results'\nTHEN the user should have full access to the results framework, just like a regular public project\n## Issue description\n\nCurrently, we have disabled the results framework in MyRSR for private projects. However, it should be possible to enter results data for private projects as well.\n\n", "before_files": [{"content": "# -*- coding: utf-8 -*-\n\n\"\"\"Akvo RSR is covered by the GNU Affero General Public License.\nSee more details in the license.txt file located at the root folder of the\nAkvo RSR module. For additional details on the GNU license please\nsee < http://www.gnu.org/licenses/agpl.html >.\n\"\"\"\n\nfrom akvo.rest.serializers import (TypeaheadCountrySerializer,\n                                   TypeaheadOrganisationSerializer,\n                                   TypeaheadProjectSerializer,\n                                   TypeaheadProjectUpdateSerializer)\nfrom akvo.rsr.models import Country, Organisation, Project, ProjectUpdate\n\nfrom rest_framework.decorators import api_view\nfrom rest_framework.response import Response\n\n\ndef rejig(queryset, serializer):\n    \"\"\"Rearrange & add queryset count to the response data.\"\"\"\n    return {\n        'count': queryset.count(),\n        'results': serializer.data\n    }\n\n\n@api_view(['GET'])\ndef typeahead_country(request):\n    countries = Country.objects.all()\n    return Response(\n        rejig(countries, TypeaheadCountrySerializer(countries, many=True))\n    )\n\n\n@api_view(['GET'])\ndef typeahead_organisation(request):\n    organisations = Organisation.objects.all()\n    return Response(\n        rejig(organisations, TypeaheadOrganisationSerializer(organisations,\n                                                             many=True))\n    )\n\n\n@api_view(['GET'])\ndef typeahead_user_organisations(request):\n    user = request.user\n    is_admin = user.is_active and (user.is_superuser or user.is_admin)\n    organisations = user.approved_organisations() if not is_admin else Organisation.objects.all()\n    return Response(\n        rejig(organisations, TypeaheadOrganisationSerializer(organisations,\n                                                             many=True))\n    )\n\n\n@api_view(['GET'])\ndef typeahead_project(request):\n    projects = Project.objects.all().exclude(title='')\n    return Response(\n        rejig(projects, TypeaheadProjectSerializer(projects, many=True))\n    )\n\n\n@api_view(['GET'])\ndef typeahead_user_projects(request):\n    user = request.user\n    is_admin = user.is_active and (user.is_superuser or user.is_admin)\n    if is_admin:\n        projects = Project.objects.all()\n    else:\n        projects = user.approved_organisations().all_projects()\n    projects = projects.exclude(title='')\n    return Response(\n        rejig(projects, TypeaheadProjectSerializer(projects, many=True))\n    )\n\n\n@api_view(['GET'])\ndef typeahead_impact_projects(request):\n    user = request.user\n    projects = Project.objects.all() if user.is_admin or user.is_superuser else user.my_projects()\n    projects = projects.published().filter(is_impact_project=True, is_public=True).order_by('title')\n\n    return Response(\n        rejig(projects, TypeaheadProjectSerializer(projects, many=True))\n    )\n\n\n@api_view(['GET'])\ndef typeahead_projectupdate(request):\n    updates = ProjectUpdate.objects.all()\n    return Response(\n        rejig(updates, TypeaheadProjectUpdateSerializer(updates, many=True))\n    )\n", "path": "akvo/rest/views/typeahead.py"}], "after_files": [{"content": "# -*- coding: utf-8 -*-\n\n\"\"\"Akvo RSR is covered by the GNU Affero General Public License.\nSee more details in the license.txt file located at the root folder of the\nAkvo RSR module. For additional details on the GNU license please\nsee < http://www.gnu.org/licenses/agpl.html >.\n\"\"\"\n\nfrom akvo.rest.serializers import (TypeaheadCountrySerializer,\n                                   TypeaheadOrganisationSerializer,\n                                   TypeaheadProjectSerializer,\n                                   TypeaheadProjectUpdateSerializer)\nfrom akvo.rsr.models import Country, Organisation, Project, ProjectUpdate\n\nfrom rest_framework.decorators import api_view\nfrom rest_framework.response import Response\n\n\ndef rejig(queryset, serializer):\n    \"\"\"Rearrange & add queryset count to the response data.\"\"\"\n    return {\n        'count': queryset.count(),\n        'results': serializer.data\n    }\n\n\n@api_view(['GET'])\ndef typeahead_country(request):\n    countries = Country.objects.all()\n    return Response(\n        rejig(countries, TypeaheadCountrySerializer(countries, many=True))\n    )\n\n\n@api_view(['GET'])\ndef typeahead_organisation(request):\n    organisations = Organisation.objects.all()\n    return Response(\n        rejig(organisations, TypeaheadOrganisationSerializer(organisations,\n                                                             many=True))\n    )\n\n\n@api_view(['GET'])\ndef typeahead_user_organisations(request):\n    user = request.user\n    is_admin = user.is_active and (user.is_superuser or user.is_admin)\n    organisations = user.approved_organisations() if not is_admin else Organisation.objects.all()\n    return Response(\n        rejig(organisations, TypeaheadOrganisationSerializer(organisations,\n                                                             many=True))\n    )\n\n\n@api_view(['GET'])\ndef typeahead_project(request):\n    projects = Project.objects.all().exclude(title='')\n    return Response(\n        rejig(projects, TypeaheadProjectSerializer(projects, many=True))\n    )\n\n\n@api_view(['GET'])\ndef typeahead_user_projects(request):\n    user = request.user\n    is_admin = user.is_active and (user.is_superuser or user.is_admin)\n    if is_admin:\n        projects = Project.objects.all()\n    else:\n        projects = user.approved_organisations().all_projects()\n    projects = projects.exclude(title='')\n    return Response(\n        rejig(projects, TypeaheadProjectSerializer(projects, many=True))\n    )\n\n\n@api_view(['GET'])\ndef typeahead_impact_projects(request):\n    user = request.user\n    projects = Project.objects.all() if user.is_admin or user.is_superuser else user.my_projects()\n    projects = projects.published().filter(is_impact_project=True).order_by('title')\n\n    return Response(\n        rejig(projects, TypeaheadProjectSerializer(projects, many=True))\n    )\n\n\n@api_view(['GET'])\ndef typeahead_projectupdate(request):\n    updates = ProjectUpdate.objects.all()\n    return Response(\n        rejig(updates, TypeaheadProjectUpdateSerializer(updates, many=True))\n    )\n", "path": "akvo/rest/views/typeahead.py"}]}