prompt: We are currently solving the following issue within our repository. Here is the issue text:
  --- BEGIN ISSUE ---
  Bug in project document category API
  ## Test plan
  
  The project_document_category should not give an error. E.g. `http://rsr.localdev.akvo.org/rest/v1/project_document_category/` should load.
  ## Issue description
  
  The project document category API gives an error. See http://sentry.support.akvo-ops.org/rsr/test/group/879/, or on the Test server: http://rsr.test.akvo.org/rest/v1/project_document_category/.
  
  
  --- 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/project_document.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 
  8 from akvo.rsr.models import ProjectDocument, ProjectDocumentCategory
  9 
  10 from ..serializers import ProjectDocumentSerializer, ProjectDocumentCategorySerializer
  11 from ..viewsets import PublicProjectViewSet
  12 
  13 
  14 class ProjectDocumentViewSet(PublicProjectViewSet):
  15     """
  16     """
  17     queryset = ProjectDocument.objects.all()
  18     serializer_class = ProjectDocumentSerializer
  19 
  20 
  21 class ProjectDocumentCategoryViewSet(PublicProjectViewSet):
  22     """
  23     """
  24     queryset = ProjectDocumentCategory.objects.all()
  25     serializer_class = ProjectDocumentCategorySerializer
  26     filter_fields = ('document__project', 'document', 'category', )
  27
  ```
  --- 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/project_document.py b/akvo/rest/views/project_document.py
  --- a/akvo/rest/views/project_document.py
  +++ b/akvo/rest/views/project_document.py
  @@ -24,3 +24,4 @@
       queryset = ProjectDocumentCategory.objects.all()
       serializer_class = ProjectDocumentCategorySerializer
       filter_fields = ('document__project', 'document', 'category', )
  +    project_relation = 'document__project__'
  
verification_info: {"golden_diff": "diff --git a/akvo/rest/views/project_document.py b/akvo/rest/views/project_document.py\n--- a/akvo/rest/views/project_document.py\n+++ b/akvo/rest/views/project_document.py\n@@ -24,3 +24,4 @@\n     queryset = ProjectDocumentCategory.objects.all()\n     serializer_class = ProjectDocumentCategorySerializer\n     filter_fields = ('document__project', 'document', 'category', )\n+    project_relation = 'document__project__'\n", "issue": "Bug in project document category API\n## Test plan\n\nThe project_document_category should not give an error. E.g. `http://rsr.localdev.akvo.org/rest/v1/project_document_category/` should load.\n## Issue description\n\nThe project document category API gives an error. See http://sentry.support.akvo-ops.org/rsr/test/group/879/, or on the Test server: http://rsr.test.akvo.org/rest/v1/project_document_category/.\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\n\nfrom akvo.rsr.models import ProjectDocument, ProjectDocumentCategory\n\nfrom ..serializers import ProjectDocumentSerializer, ProjectDocumentCategorySerializer\nfrom ..viewsets import PublicProjectViewSet\n\n\nclass ProjectDocumentViewSet(PublicProjectViewSet):\n    \"\"\"\n    \"\"\"\n    queryset = ProjectDocument.objects.all()\n    serializer_class = ProjectDocumentSerializer\n\n\nclass ProjectDocumentCategoryViewSet(PublicProjectViewSet):\n    \"\"\"\n    \"\"\"\n    queryset = ProjectDocumentCategory.objects.all()\n    serializer_class = ProjectDocumentCategorySerializer\n    filter_fields = ('document__project', 'document', 'category', )\n", "path": "akvo/rest/views/project_document.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\n\nfrom akvo.rsr.models import ProjectDocument, ProjectDocumentCategory\n\nfrom ..serializers import ProjectDocumentSerializer, ProjectDocumentCategorySerializer\nfrom ..viewsets import PublicProjectViewSet\n\n\nclass ProjectDocumentViewSet(PublicProjectViewSet):\n    \"\"\"\n    \"\"\"\n    queryset = ProjectDocument.objects.all()\n    serializer_class = ProjectDocumentSerializer\n\n\nclass ProjectDocumentCategoryViewSet(PublicProjectViewSet):\n    \"\"\"\n    \"\"\"\n    queryset = ProjectDocumentCategory.objects.all()\n    serializer_class = ProjectDocumentCategorySerializer\n    filter_fields = ('document__project', 'document', 'category', )\n    project_relation = 'document__project__'\n", "path": "akvo/rest/views/project_document.py"}]}