prompt: We are currently solving the following issue within our repository. Here is the issue text:
  --- BEGIN ISSUE ---
  Add filter/display of members-only value to document admin
  ### Is your feature request related to a problem? Please describe.
  It is not really issue to see which documents are marked as members only. And it is impossible to easily get a list with documents that have a true/false value.
  
  ### Describe the solution you'd like
  I'd like to see more information about the documents in the admin page so that I do not have to open the detail page.
  
  ### Motivation
  Easier to manage these files.
  
  ### Describe alternatives you've considered
  The only alternative is not doing this.
  
  ### Additional context
  #2084 could have been prevented.
  
  
  --- END ISSUE ---
  
  Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
  --- BEGIN FILES ---
  Path: `website/documents/admin.py`
  Content:
  ```
  1 """Registers admin interfaces for the documents module."""
  2 from django.contrib import admin
  3 from django.contrib.admin import ModelAdmin
  4 from django.utils.translation import gettext_lazy as _
  5 
  6 from documents import forms
  7 from documents.models import (
  8     AnnualDocument,
  9     AssociationDocument,
  10     EventDocument,
  11     GeneralMeeting,
  12     Minutes,
  13     MiscellaneousDocument,
  14 )
  15 from documents.services import is_owner
  16 
  17 
  18 class MinutesInline(admin.StackedInline):
  19     """Inline for minutes of a general meeting."""
  20 
  21     model = Minutes
  22     form = forms.MinutesForm
  23     extra = 0
  24 
  25 
  26 @admin.register(GeneralMeeting)
  27 class GeneralMeetingAdmin(ModelAdmin):
  28     """Manage the general meetings."""
  29 
  30     form = forms.GeneralMeetingForm
  31     inlines = [
  32         MinutesInline,
  33     ]
  34     list_filter = ("datetime",)
  35 
  36 
  37 class LectureYearFilter(admin.SimpleListFilter):
  38     """Filter the memberships on those started or ended in a lecture year."""
  39 
  40     title = _("lecture year")
  41     parameter_name = "lecture_year"
  42 
  43     def lookups(self, request, model_admin):
  44         if AnnualDocument.objects.count() > 0:
  45             first_year = AnnualDocument.objects.order_by("year").first().year
  46             last_year = AnnualDocument.objects.order_by("year").last().year
  47 
  48             return [
  49                 (year, f"{year}-{year + 1}")
  50                 for year in range(last_year, first_year - 1, -1)
  51             ]
  52         return []
  53 
  54     def queryset(self, request, queryset):
  55         if not self.value():
  56             return queryset
  57 
  58         year = int(self.value())
  59 
  60         return queryset.filter(year=year)
  61 
  62 
  63 @admin.register(AnnualDocument)
  64 class AnnualDocumentAdmin(ModelAdmin):
  65     """Manage the annual documents."""
  66 
  67     form = forms.AnnualDocumentForm
  68     list_filter = (
  69         LectureYearFilter,
  70         "created",
  71         "last_updated",
  72     )
  73 
  74 
  75 @admin.register(AssociationDocument)
  76 class AssociationDocumentAdmin(ModelAdmin):
  77     """Manage the association documents."""
  78 
  79     form = forms.AssociationDocumentForm
  80     list_filter = (
  81         "created",
  82         "last_updated",
  83     )
  84 
  85 
  86 @admin.register(EventDocument)
  87 class EventDocumentAdmin(ModelAdmin):
  88     """Manage the event documents."""
  89 
  90     form = forms.EventDocumentForm
  91     list_filter = (
  92         "created",
  93         "last_updated",
  94     )
  95 
  96     def has_change_permission(self, request, obj=None):
  97         """Only allow access to the change form if the user is an owner."""
  98         if obj is not None and not is_owner(request.member, obj):
  99             return False
  100         return super().has_change_permission(request, obj)
  101 
  102     def has_delete_permission(self, request, obj=None):
  103         """Only allow delete access if the user is an owner."""
  104         if obj is not None and not is_owner(request.member, obj):
  105             return False
  106         return super().has_delete_permission(request, obj)
  107 
  108 
  109 @admin.register(MiscellaneousDocument)
  110 class MiscellaneousDocumentAdmin(ModelAdmin):
  111     """Manage the miscellaneous documents."""
  112 
  113     form = forms.MiscellaneousDocumentForm
  114     list_filter = (
  115         "created",
  116         "last_updated",
  117     )
  118
  ```
  --- 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/website/documents/admin.py b/website/documents/admin.py
  --- a/website/documents/admin.py
  +++ b/website/documents/admin.py
  @@ -69,6 +69,11 @@
           LectureYearFilter,
           "created",
           "last_updated",
  +        "members_only",
  +    )
  +    list_display = (
  +        "__str__",
  +        "members_only",
       )
   
   
  @@ -80,6 +85,11 @@
       list_filter = (
           "created",
           "last_updated",
  +        "members_only",
  +    )
  +    list_display = (
  +        "__str__",
  +        "members_only",
       )
   
   
  @@ -91,6 +101,11 @@
       list_filter = (
           "created",
           "last_updated",
  +        "members_only",
  +    )
  +    list_display = (
  +        "__str__",
  +        "members_only",
       )
   
       def has_change_permission(self, request, obj=None):
  @@ -114,4 +129,9 @@
       list_filter = (
           "created",
           "last_updated",
  +        "members_only",
  +    )
  +    list_display = (
  +        "__str__",
  +        "members_only",
       )
  
verification_info: {"golden_diff": "diff --git a/website/documents/admin.py b/website/documents/admin.py\n--- a/website/documents/admin.py\n+++ b/website/documents/admin.py\n@@ -69,6 +69,11 @@\n         LectureYearFilter,\n         \"created\",\n         \"last_updated\",\n+        \"members_only\",\n+    )\n+    list_display = (\n+        \"__str__\",\n+        \"members_only\",\n     )\n \n \n@@ -80,6 +85,11 @@\n     list_filter = (\n         \"created\",\n         \"last_updated\",\n+        \"members_only\",\n+    )\n+    list_display = (\n+        \"__str__\",\n+        \"members_only\",\n     )\n \n \n@@ -91,6 +101,11 @@\n     list_filter = (\n         \"created\",\n         \"last_updated\",\n+        \"members_only\",\n+    )\n+    list_display = (\n+        \"__str__\",\n+        \"members_only\",\n     )\n \n     def has_change_permission(self, request, obj=None):\n@@ -114,4 +129,9 @@\n     list_filter = (\n         \"created\",\n         \"last_updated\",\n+        \"members_only\",\n+    )\n+    list_display = (\n+        \"__str__\",\n+        \"members_only\",\n     )\n", "issue": "Add filter/display of members-only value to document admin\n### Is your feature request related to a problem? Please describe.\r\nIt is not really issue to see which documents are marked as members only. And it is impossible to easily get a list with documents that have a true/false value.\r\n\r\n### Describe the solution you'd like\r\nI'd like to see more information about the documents in the admin page so that I do not have to open the detail page.\r\n\r\n### Motivation\r\nEasier to manage these files.\r\n\r\n### Describe alternatives you've considered\r\nThe only alternative is not doing this.\r\n\r\n### Additional context\r\n#2084 could have been prevented.\r\n\n", "before_files": [{"content": "\"\"\"Registers admin interfaces for the documents module.\"\"\"\nfrom django.contrib import admin\nfrom django.contrib.admin import ModelAdmin\nfrom django.utils.translation import gettext_lazy as _\n\nfrom documents import forms\nfrom documents.models import (\n    AnnualDocument,\n    AssociationDocument,\n    EventDocument,\n    GeneralMeeting,\n    Minutes,\n    MiscellaneousDocument,\n)\nfrom documents.services import is_owner\n\n\nclass MinutesInline(admin.StackedInline):\n    \"\"\"Inline for minutes of a general meeting.\"\"\"\n\n    model = Minutes\n    form = forms.MinutesForm\n    extra = 0\n\n\n@admin.register(GeneralMeeting)\nclass GeneralMeetingAdmin(ModelAdmin):\n    \"\"\"Manage the general meetings.\"\"\"\n\n    form = forms.GeneralMeetingForm\n    inlines = [\n        MinutesInline,\n    ]\n    list_filter = (\"datetime\",)\n\n\nclass LectureYearFilter(admin.SimpleListFilter):\n    \"\"\"Filter the memberships on those started or ended in a lecture year.\"\"\"\n\n    title = _(\"lecture year\")\n    parameter_name = \"lecture_year\"\n\n    def lookups(self, request, model_admin):\n        if AnnualDocument.objects.count() > 0:\n            first_year = AnnualDocument.objects.order_by(\"year\").first().year\n            last_year = AnnualDocument.objects.order_by(\"year\").last().year\n\n            return [\n                (year, f\"{year}-{year + 1}\")\n                for year in range(last_year, first_year - 1, -1)\n            ]\n        return []\n\n    def queryset(self, request, queryset):\n        if not self.value():\n            return queryset\n\n        year = int(self.value())\n\n        return queryset.filter(year=year)\n\n\n@admin.register(AnnualDocument)\nclass AnnualDocumentAdmin(ModelAdmin):\n    \"\"\"Manage the annual documents.\"\"\"\n\n    form = forms.AnnualDocumentForm\n    list_filter = (\n        LectureYearFilter,\n        \"created\",\n        \"last_updated\",\n    )\n\n\n@admin.register(AssociationDocument)\nclass AssociationDocumentAdmin(ModelAdmin):\n    \"\"\"Manage the association documents.\"\"\"\n\n    form = forms.AssociationDocumentForm\n    list_filter = (\n        \"created\",\n        \"last_updated\",\n    )\n\n\n@admin.register(EventDocument)\nclass EventDocumentAdmin(ModelAdmin):\n    \"\"\"Manage the event documents.\"\"\"\n\n    form = forms.EventDocumentForm\n    list_filter = (\n        \"created\",\n        \"last_updated\",\n    )\n\n    def has_change_permission(self, request, obj=None):\n        \"\"\"Only allow access to the change form if the user is an owner.\"\"\"\n        if obj is not None and not is_owner(request.member, obj):\n            return False\n        return super().has_change_permission(request, obj)\n\n    def has_delete_permission(self, request, obj=None):\n        \"\"\"Only allow delete access if the user is an owner.\"\"\"\n        if obj is not None and not is_owner(request.member, obj):\n            return False\n        return super().has_delete_permission(request, obj)\n\n\n@admin.register(MiscellaneousDocument)\nclass MiscellaneousDocumentAdmin(ModelAdmin):\n    \"\"\"Manage the miscellaneous documents.\"\"\"\n\n    form = forms.MiscellaneousDocumentForm\n    list_filter = (\n        \"created\",\n        \"last_updated\",\n    )\n", "path": "website/documents/admin.py"}], "after_files": [{"content": "\"\"\"Registers admin interfaces for the documents module.\"\"\"\nfrom django.contrib import admin\nfrom django.contrib.admin import ModelAdmin\nfrom django.utils.translation import gettext_lazy as _\n\nfrom documents import forms\nfrom documents.models import (\n    AnnualDocument,\n    AssociationDocument,\n    EventDocument,\n    GeneralMeeting,\n    Minutes,\n    MiscellaneousDocument,\n)\nfrom documents.services import is_owner\n\n\nclass MinutesInline(admin.StackedInline):\n    \"\"\"Inline for minutes of a general meeting.\"\"\"\n\n    model = Minutes\n    form = forms.MinutesForm\n    extra = 0\n\n\n@admin.register(GeneralMeeting)\nclass GeneralMeetingAdmin(ModelAdmin):\n    \"\"\"Manage the general meetings.\"\"\"\n\n    form = forms.GeneralMeetingForm\n    inlines = [\n        MinutesInline,\n    ]\n    list_filter = (\"datetime\",)\n\n\nclass LectureYearFilter(admin.SimpleListFilter):\n    \"\"\"Filter the memberships on those started or ended in a lecture year.\"\"\"\n\n    title = _(\"lecture year\")\n    parameter_name = \"lecture_year\"\n\n    def lookups(self, request, model_admin):\n        if AnnualDocument.objects.count() > 0:\n            first_year = AnnualDocument.objects.order_by(\"year\").first().year\n            last_year = AnnualDocument.objects.order_by(\"year\").last().year\n\n            return [\n                (year, f\"{year}-{year + 1}\")\n                for year in range(last_year, first_year - 1, -1)\n            ]\n        return []\n\n    def queryset(self, request, queryset):\n        if not self.value():\n            return queryset\n\n        year = int(self.value())\n\n        return queryset.filter(year=year)\n\n\n@admin.register(AnnualDocument)\nclass AnnualDocumentAdmin(ModelAdmin):\n    \"\"\"Manage the annual documents.\"\"\"\n\n    form = forms.AnnualDocumentForm\n    list_filter = (\n        LectureYearFilter,\n        \"created\",\n        \"last_updated\",\n        \"members_only\",\n    )\n    list_display = (\n        \"__str__\",\n        \"members_only\",\n    )\n\n\n@admin.register(AssociationDocument)\nclass AssociationDocumentAdmin(ModelAdmin):\n    \"\"\"Manage the association documents.\"\"\"\n\n    form = forms.AssociationDocumentForm\n    list_filter = (\n        \"created\",\n        \"last_updated\",\n        \"members_only\",\n    )\n    list_display = (\n        \"__str__\",\n        \"members_only\",\n    )\n\n\n@admin.register(EventDocument)\nclass EventDocumentAdmin(ModelAdmin):\n    \"\"\"Manage the event documents.\"\"\"\n\n    form = forms.EventDocumentForm\n    list_filter = (\n        \"created\",\n        \"last_updated\",\n        \"members_only\",\n    )\n    list_display = (\n        \"__str__\",\n        \"members_only\",\n    )\n\n    def has_change_permission(self, request, obj=None):\n        \"\"\"Only allow access to the change form if the user is an owner.\"\"\"\n        if obj is not None and not is_owner(request.member, obj):\n            return False\n        return super().has_change_permission(request, obj)\n\n    def has_delete_permission(self, request, obj=None):\n        \"\"\"Only allow delete access if the user is an owner.\"\"\"\n        if obj is not None and not is_owner(request.member, obj):\n            return False\n        return super().has_delete_permission(request, obj)\n\n\n@admin.register(MiscellaneousDocument)\nclass MiscellaneousDocumentAdmin(ModelAdmin):\n    \"\"\"Manage the miscellaneous documents.\"\"\"\n\n    form = forms.MiscellaneousDocumentForm\n    list_filter = (\n        \"created\",\n        \"last_updated\",\n        \"members_only\",\n    )\n    list_display = (\n        \"__str__\",\n        \"members_only\",\n    )\n", "path": "website/documents/admin.py"}]}