We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
text commenting results show module detail 
when only text commenting module used for project, module detail also shown in results tab

--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `meinberlin/apps/documents/views.py`
Content:
```
1 from django.http import Http404
2 from django.http.response import HttpResponseRedirect
3 from django.urls import reverse
4 from django.utils.translation import ugettext_lazy as _
5 from django.views import generic
6 
7 from adhocracy4.dashboard import mixins as dashboard_mixins
8 from adhocracy4.projects.mixins import ProjectMixin
9 from adhocracy4.rules import mixins as rules_mixins
10 from meinberlin.apps.contrib import mixins as contrib_mixins
11 from meinberlin.apps.exports.views import DashboardExportView
12 
13 from . import models
14 
15 
16 class DocumentDashboardView(ProjectMixin,
17                             dashboard_mixins.DashboardBaseMixin,
18                             dashboard_mixins.DashboardComponentMixin,
19                             generic.TemplateView):
20     template_name = 'meinberlin_documents/document_dashboard.html'
21     permission_required = 'a4projects.change_project'
22 
23     def get_permission_object(self):
24         return self.project
25 
26 
27 class ChapterDetailView(ProjectMixin,
28                         rules_mixins.PermissionRequiredMixin,
29                         generic.DetailView,
30                         contrib_mixins.DisplayProjectOrModuleMixin):
31     model = models.Chapter
32     permission_required = 'meinberlin_documents.view_chapter'
33     get_context_from_object = True
34 
35     def dispatch(self, request, *args, **kwargs):
36         # Redirect first chapter view to the project detail page
37         res = super().dispatch(request, *args, **kwargs)
38         chapter = self.get_object()
39         if self.request.path == chapter.get_absolute_url() \
40                 and chapter == self.chapter_list.first():
41             return HttpResponseRedirect(self.project.get_absolute_url())
42         else:
43             return res
44 
45     def get_context_data(self, **kwargs):
46         context = super(ChapterDetailView, self).get_context_data(**kwargs)
47         context['chapter_list'] = self.chapter_list
48         return context
49 
50     @property
51     def chapter_list(self):
52         return models.Chapter.objects.filter(module=self.module)
53 
54 
55 class DocumentDetailView(ChapterDetailView):
56     get_context_from_object = False
57 
58     def get_object(self):
59         first_chapter = models.Chapter.objects \
60             .filter(module=self.module) \
61             .first()
62 
63         if not first_chapter:
64             raise Http404(_('Document has no chapters defined.'))
65         return first_chapter
66 
67 
68 class ParagraphDetailView(ProjectMixin,
69                           rules_mixins.PermissionRequiredMixin,
70                           generic.DetailView):
71     model = models.Paragraph
72     permission_required = 'meinberlin_documents.view_paragraph'
73 
74 
75 class DocumentDashboardExportView(DashboardExportView):
76     template_name = 'meinberlin_exports/export_dashboard.html'
77 
78     def get_context_data(self, **kwargs):
79         context = super().get_context_data(**kwargs)
80         context['comment_export'] = reverse(
81             'a4dashboard:document-comment-export',
82             kwargs={'module_slug': self.module.slug})
83         return context
84
```
--- 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()

```

diff --git a/meinberlin/apps/documents/views.py b/meinberlin/apps/documents/views.py
--- a/meinberlin/apps/documents/views.py
+++ b/meinberlin/apps/documents/views.py
@@ -1,5 +1,4 @@
 from django.http import Http404
-from django.http.response import HttpResponseRedirect
 from django.urls import reverse
 from django.utils.translation import ugettext_lazy as _
 from django.views import generic
@@ -32,16 +31,6 @@
     permission_required = 'meinberlin_documents.view_chapter'
     get_context_from_object = True
 
-    def dispatch(self, request, *args, **kwargs):
-        # Redirect first chapter view to the project detail page
-        res = super().dispatch(request, *args, **kwargs)
-        chapter = self.get_object()
-        if self.request.path == chapter.get_absolute_url() \
-                and chapter == self.chapter_list.first():
-            return HttpResponseRedirect(self.project.get_absolute_url())
-        else:
-            return res
-
     def get_context_data(self, **kwargs):
         context = super(ChapterDetailView, self).get_context_data(**kwargs)
         context['chapter_list'] = self.chapter_list

{"golden_diff": "diff --git a/meinberlin/apps/documents/views.py b/meinberlin/apps/documents/views.py\n--- a/meinberlin/apps/documents/views.py\n+++ b/meinberlin/apps/documents/views.py\n@@ -1,5 +1,4 @@\n from django.http import Http404\n-from django.http.response import HttpResponseRedirect\n from django.urls import reverse\n from django.utils.translation import ugettext_lazy as _\n from django.views import generic\n@@ -32,16 +31,6 @@\n     permission_required = 'meinberlin_documents.view_chapter'\n     get_context_from_object = True\n \n-    def dispatch(self, request, *args, **kwargs):\n-        # Redirect first chapter view to the project detail page\n-        res = super().dispatch(request, *args, **kwargs)\n-        chapter = self.get_object()\n-        if self.request.path == chapter.get_absolute_url() \\\n-                and chapter == self.chapter_list.first():\n-            return HttpResponseRedirect(self.project.get_absolute_url())\n-        else:\n-            return res\n-\n     def get_context_data(self, **kwargs):\n         context = super(ChapterDetailView, self).get_context_data(**kwargs)\n         context['chapter_list'] = self.chapter_list\n", "issue": "text commenting results show module detail \nwhen only text commenting module used for project, module detail also shown in results tab\n", "before_files": [{"content": "from django.http import Http404\nfrom django.http.response import HttpResponseRedirect\nfrom django.urls import reverse\nfrom django.utils.translation import ugettext_lazy as _\nfrom django.views import generic\n\nfrom adhocracy4.dashboard import mixins as dashboard_mixins\nfrom adhocracy4.projects.mixins import ProjectMixin\nfrom adhocracy4.rules import mixins as rules_mixins\nfrom meinberlin.apps.contrib import mixins as contrib_mixins\nfrom meinberlin.apps.exports.views import DashboardExportView\n\nfrom . import models\n\n\nclass DocumentDashboardView(ProjectMixin,\n                            dashboard_mixins.DashboardBaseMixin,\n                            dashboard_mixins.DashboardComponentMixin,\n                            generic.TemplateView):\n    template_name = 'meinberlin_documents/document_dashboard.html'\n    permission_required = 'a4projects.change_project'\n\n    def get_permission_object(self):\n        return self.project\n\n\nclass ChapterDetailView(ProjectMixin,\n                        rules_mixins.PermissionRequiredMixin,\n                        generic.DetailView,\n                        contrib_mixins.DisplayProjectOrModuleMixin):\n    model = models.Chapter\n    permission_required = 'meinberlin_documents.view_chapter'\n    get_context_from_object = True\n\n    def dispatch(self, request, *args, **kwargs):\n        # Redirect first chapter view to the project detail page\n        res = super().dispatch(request, *args, **kwargs)\n        chapter = self.get_object()\n        if self.request.path == chapter.get_absolute_url() \\\n                and chapter == self.chapter_list.first():\n            return HttpResponseRedirect(self.project.get_absolute_url())\n        else:\n            return res\n\n    def get_context_data(self, **kwargs):\n        context = super(ChapterDetailView, self).get_context_data(**kwargs)\n        context['chapter_list'] = self.chapter_list\n        return context\n\n    @property\n    def chapter_list(self):\n        return models.Chapter.objects.filter(module=self.module)\n\n\nclass DocumentDetailView(ChapterDetailView):\n    get_context_from_object = False\n\n    def get_object(self):\n        first_chapter = models.Chapter.objects \\\n            .filter(module=self.module) \\\n            .first()\n\n        if not first_chapter:\n            raise Http404(_('Document has no chapters defined.'))\n        return first_chapter\n\n\nclass ParagraphDetailView(ProjectMixin,\n                          rules_mixins.PermissionRequiredMixin,\n                          generic.DetailView):\n    model = models.Paragraph\n    permission_required = 'meinberlin_documents.view_paragraph'\n\n\nclass DocumentDashboardExportView(DashboardExportView):\n    template_name = 'meinberlin_exports/export_dashboard.html'\n\n    def get_context_data(self, **kwargs):\n        context = super().get_context_data(**kwargs)\n        context['comment_export'] = reverse(\n            'a4dashboard:document-comment-export',\n            kwargs={'module_slug': self.module.slug})\n        return context\n", "path": "meinberlin/apps/documents/views.py"}], "after_files": [{"content": "from django.http import Http404\nfrom django.urls import reverse\nfrom django.utils.translation import ugettext_lazy as _\nfrom django.views import generic\n\nfrom adhocracy4.dashboard import mixins as dashboard_mixins\nfrom adhocracy4.projects.mixins import ProjectMixin\nfrom adhocracy4.rules import mixins as rules_mixins\nfrom meinberlin.apps.contrib import mixins as contrib_mixins\nfrom meinberlin.apps.exports.views import DashboardExportView\n\nfrom . import models\n\n\nclass DocumentDashboardView(ProjectMixin,\n                            dashboard_mixins.DashboardBaseMixin,\n                            dashboard_mixins.DashboardComponentMixin,\n                            generic.TemplateView):\n    template_name = 'meinberlin_documents/document_dashboard.html'\n    permission_required = 'a4projects.change_project'\n\n    def get_permission_object(self):\n        return self.project\n\n\nclass ChapterDetailView(ProjectMixin,\n                        rules_mixins.PermissionRequiredMixin,\n                        generic.DetailView,\n                        contrib_mixins.DisplayProjectOrModuleMixin):\n    model = models.Chapter\n    permission_required = 'meinberlin_documents.view_chapter'\n    get_context_from_object = True\n\n    def get_context_data(self, **kwargs):\n        context = super(ChapterDetailView, self).get_context_data(**kwargs)\n        context['chapter_list'] = self.chapter_list\n        return context\n\n    @property\n    def chapter_list(self):\n        return models.Chapter.objects.filter(module=self.module)\n\n\nclass DocumentDetailView(ChapterDetailView):\n    get_context_from_object = False\n\n    def get_object(self):\n        first_chapter = models.Chapter.objects \\\n            .filter(module=self.module) \\\n            .first()\n\n        if not first_chapter:\n            raise Http404(_('Document has no chapters defined.'))\n        return first_chapter\n\n\nclass ParagraphDetailView(ProjectMixin,\n                          rules_mixins.PermissionRequiredMixin,\n                          generic.DetailView):\n    model = models.Paragraph\n    permission_required = 'meinberlin_documents.view_paragraph'\n\n\nclass DocumentDashboardExportView(DashboardExportView):\n    template_name = 'meinberlin_exports/export_dashboard.html'\n\n    def get_context_data(self, **kwargs):\n        context = super().get_context_data(**kwargs)\n        context['comment_export'] = reverse(\n            'a4dashboard:document-comment-export',\n            kwargs={'module_slug': self.module.slug})\n        return context\n", "path": "meinberlin/apps/documents/views.py"}]}