prompt: We are currently solving the following issue within our repository. Here is the issue text:
  --- BEGIN ISSUE ---
  Public projects filter in REST API not working correctly
  ## Test plan
  
  All projects (and other objects) should be displayed in the REST API.
  ## Issue description
  
  As a quick fix, just display all projects (public and private) in the API.
  
  
  --- 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/viewsets.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 rest_framework import filters
  8 from rest_framework import viewsets
  9 from rest_framework.authentication import SessionAuthentication
  10 from rest_framework.permissions import DjangoObjectPermissions
  11 
  12 from .models import TastyTokenAuthentication
  13 
  14 from akvo.rsr.models import Project
  15 
  16 
  17 class BaseRSRViewSet(viewsets.ModelViewSet):
  18     """
  19     Base class used for the view sets for RSR models. Provides unified auth and perms settings.
  20     Only public projects will be shown by filtering the queryset.
  21     """
  22     authentication_classes = (SessionAuthentication, TastyTokenAuthentication, )
  23     permission_classes = (DjangoObjectPermissions, )
  24     filter_backends = (filters.DjangoFilterBackend, filters.OrderingFilter, )
  25     ordering_fields = '__all__'
  26 
  27     def get_queryset(self):
  28         """Filter out any private projects."""
  29         for related_obj in self.queryset.model._meta.get_all_related_objects():
  30             if related_obj.model == Project:
  31                 self.queryset = self.queryset.filter(project__is_public=True)
  32                 break
  33         return super(BaseRSRViewSet, self).get_queryset()
  34
  ```
  --- 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/viewsets.py b/akvo/rest/viewsets.py
  --- a/akvo/rest/viewsets.py
  +++ b/akvo/rest/viewsets.py
  @@ -23,11 +23,3 @@
       permission_classes = (DjangoObjectPermissions, )
       filter_backends = (filters.DjangoFilterBackend, filters.OrderingFilter, )
       ordering_fields = '__all__'
  -
  -    def get_queryset(self):
  -        """Filter out any private projects."""
  -        for related_obj in self.queryset.model._meta.get_all_related_objects():
  -            if related_obj.model == Project:
  -                self.queryset = self.queryset.filter(project__is_public=True)
  -                break
  -        return super(BaseRSRViewSet, self).get_queryset()
  
verification_info: {"golden_diff": "diff --git a/akvo/rest/viewsets.py b/akvo/rest/viewsets.py\n--- a/akvo/rest/viewsets.py\n+++ b/akvo/rest/viewsets.py\n@@ -23,11 +23,3 @@\n     permission_classes = (DjangoObjectPermissions, )\n     filter_backends = (filters.DjangoFilterBackend, filters.OrderingFilter, )\n     ordering_fields = '__all__'\n-\n-    def get_queryset(self):\n-        \"\"\"Filter out any private projects.\"\"\"\n-        for related_obj in self.queryset.model._meta.get_all_related_objects():\n-            if related_obj.model == Project:\n-                self.queryset = self.queryset.filter(project__is_public=True)\n-                break\n-        return super(BaseRSRViewSet, self).get_queryset()\n", "issue": "Public projects filter in REST API not working correctly\n## Test plan\n\nAll projects (and other objects) should be displayed in the REST API.\n## Issue description\n\nAs a quick fix, just display all projects (public and private) in the API.\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 rest_framework import filters\nfrom rest_framework import viewsets\nfrom rest_framework.authentication import SessionAuthentication\nfrom rest_framework.permissions import DjangoObjectPermissions\n\nfrom .models import TastyTokenAuthentication\n\nfrom akvo.rsr.models import Project\n\n\nclass BaseRSRViewSet(viewsets.ModelViewSet):\n    \"\"\"\n    Base class used for the view sets for RSR models. Provides unified auth and perms settings.\n    Only public projects will be shown by filtering the queryset.\n    \"\"\"\n    authentication_classes = (SessionAuthentication, TastyTokenAuthentication, )\n    permission_classes = (DjangoObjectPermissions, )\n    filter_backends = (filters.DjangoFilterBackend, filters.OrderingFilter, )\n    ordering_fields = '__all__'\n\n    def get_queryset(self):\n        \"\"\"Filter out any private projects.\"\"\"\n        for related_obj in self.queryset.model._meta.get_all_related_objects():\n            if related_obj.model == Project:\n                self.queryset = self.queryset.filter(project__is_public=True)\n                break\n        return super(BaseRSRViewSet, self).get_queryset()\n", "path": "akvo/rest/viewsets.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 rest_framework import filters\nfrom rest_framework import viewsets\nfrom rest_framework.authentication import SessionAuthentication\nfrom rest_framework.permissions import DjangoObjectPermissions\n\nfrom .models import TastyTokenAuthentication\n\nfrom akvo.rsr.models import Project\n\n\nclass BaseRSRViewSet(viewsets.ModelViewSet):\n    \"\"\"\n    Base class used for the view sets for RSR models. Provides unified auth and perms settings.\n    Only public projects will be shown by filtering the queryset.\n    \"\"\"\n    authentication_classes = (SessionAuthentication, TastyTokenAuthentication, )\n    permission_classes = (DjangoObjectPermissions, )\n    filter_backends = (filters.DjangoFilterBackend, filters.OrderingFilter, )\n    ordering_fields = '__all__'\n", "path": "akvo/rest/viewsets.py"}]}